-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for per-directory configuration #5833
Conversation
@matusvalo Thanks for taking the time to look into this. I haven't looked at the code at all, but: I'd like to wait with doing this until the transition to |
I have looked in PR #5584 and the changes are in different levels. This PR is changing mainly interaction with EDIT: I read the commend second time and I saw that you are going to change handling of configuration file - yes this can affect this PR definitely. But in any case, I think it would be beneficial to review this PR, maybe it will help with your changes and I am willing to update this PR based on your changes elsewhere. |
The problem is that I'm not really sure how we're going to change things. In |
No problem take your time. Ping me when I can proceed with this. Till then I will put this on hold. |
@matusvalo I have complete most of the transition to What about storing the modules, closest configuration and a namespace object for that configuration? We would only need to reparse the configuration file and command line for each config file and then before we lint a file set the correct namespace object to |
If I remember the code correctly, the PR is creating new linter not for every module but only for every rcfile. I don't suppose that project will have more than several rc files - e.g. one for the code base and one for unittests. Hence for all current project having just one configuration file, the overhead is 0 except the need of scanning the FS tree for files which we need to do anyway.
This is also possibility. I need to merge main, review changes and determine how complex it would be to implement. |
@matusvalo I'm not sure if you're still interested in this, but I have done some preliminary work here: I think some of the changes in this PR can be helpful for that approach, but we just need to extract them into their own PRs. Let me know if you're still interested and want me to help you do so! |
This PR needs take over because because it has been open 8 weeks with no activity. |
Closing this as it has become outdated. Thanks for the inspiration though matus! |
Type of Changes
Description
This simple implementation of per-directory configuration file is done by moving discovery code outside of PyLinter class. During executing of pylint, list of modules/packages to be analysed is created and for each of the module/package is discovered "closest" configuration file - hence mapping of configuration file and list of packages/modules covered by configuration file is created. Then separate linter is created for each configuration file.
PROS:
CONS:
TODO:
doc/whatsnew/<current release.rst>
.Closes #618