pylint_runner icon indicating copy to clipboard operation
pylint_runner copied to clipboard

Use pylint config parser for pyproject.toml and setup.cfg support

Open kevinoid opened this issue 2 years ago • 3 comments

Pylint 2.5.0 and later support reading configuration from pyproject.toml or setup.cfg if pylintrc and .pylintrc do not exist. (PyCQA/pylint#3169) In order to support these configuration files, this PR changes pylint_runner to use pylint.lint.pylinter.PyLinter#read_config_file() instead of configparser.ConfigParser#read() to read the pylint configuration.

It also adds a check to avoid configparser.NoOptionError if ignore is not configured and to strip whitespace from ignore values as pylint does. If you would prefer these to be moved to a separate PR, let me know.

Thanks, Kevin

kevinoid avatar Aug 25 '21 16:08 kevinoid

For reference, the test failures don't appear to be related to this PR (since it doesn't change setup.py or tests/test_runner.py which are causing the pylint check to fail). I'd be happy to rebase this PR once those issues are fixed.

kevinoid avatar Aug 25 '21 18:08 kevinoid

Sorry about that @kevinoid. Master has been fixed and tests are passing once again.

MasterOdin avatar Aug 26 '21 04:08 MasterOdin

No worries. Thanks for the quick fix @MasterOdin! It should pass the CI tests now.

I added an additional commit to avoid modifying Runner.DEFAULT_ARGS (4cb3cee051de5cecb1821494cace319356335693) which was causing the changes to fail the test unnecessarily. If you'd like to consider that as a separate PR first, let me know.

kevinoid avatar Aug 26 '21 11:08 kevinoid