Skip to content

pylint not finding the tox.ini config #9727

@rlalik

Description

@rlalik

Bug description

According to documentation: https://pylint.readthedocs.io/en/v3.2.3/user_guide/usage/run.html
pylint should be able to find tox.ini and use configuration from it.

In my case however it is not doing it. It works if I explicitely ask to use tox.ini with --rcfile.

Configuration

[tox]
env_list =
    py313
    py312
    py311
    py310
    py39
    py38
    type
    linter
    flake8

[testenv]
deps = -r {toxinidir}/requirements_test.txt
commands = pytest

[testenv:flake8]
deps = -r {toxinidir}/requirements_test.txt
commands = flake8

[flake8]
exclude = .tox,tests
max-line-length = 120


[testenv:type]
deps = -r {toxinidir}/requirements_test.txt
commands = mypy --ignore-missing-imports .

[testenv:pylint]
deps = pylint
commands = pylint *.py

[pylint]
disable = C0114,C0115,C0116

Command used

pylint fraction.py -v

Pylint output

No config file found, using default configuration
************* Module fraction
fraction.py:1:0: C0114: Missing module docstring (missing-module-docstring)
fraction.py:4:0: C0115: Missing class docstring (missing-class-docstring)
fraction.py:63:4: C0116: Missing function or method docstring (missing-function-docstring)
fraction.py:66:4: C0116: Missing function or method docstring (missing-function-docstring)

---------------------------------------------------------------------------------------------------
Your code has been rated at 9.02/10 (previous run: 9.02/10, +0.00)
Checked 1 files, skipped 1 files

Expected behavior

Same as using with --rcfile:

$ pylint fraction.py -v --rcfile=tox.ini
Using config file tox.ini

----------------------------------------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.02/10, +0.98)
Checked 1 files, skipped 1 files

Pylint version

pylint 3.2.3
astroid 3.2.2
Python 3.12.3 (main, May 22 2024, 16:56:59) [GCC 13.3.0]

OS / Environment

Gentoo

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions