-
Notifications
You must be signed in to change notification settings - Fork 288
Allow configuring pycodestyle options from the PYLS config #146
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
Conversation
|
Thanks a lot for the super fast fix, this is awesome. Though I feel like the config from files like |
|
Are there any precedents in this space? I’m trying to draw parallels with things like IntelliJ checkstyle inspections etc.
The config sources are:
* files in a user’s home directory (user configs)
* files in the project (project configs)
* within the file (e.g. # noqa)
* IDE settings (the ones in question)
I’m going to take linting as the example here. Obviously “within the file” should win always, so let’s dismiss those settings.
My thinking is that project configs are configured to be verified at CI/build time. They basically say, “I don’t care who works on the project, they need to conform to this style guide”.
User configs (in their home directory) are there for when project configs don’t exist. You’re working on a project that doesn’t have any style preference explicitly checked in, so you’re going to apply your own preferences for your work only.
So project configs override user configs when running the linter.
IDE settings then exist to customise the user’s editing experience. In applying these settings they are choosing to ignore what the project says, and go with their own style. So they should override the project settings.
* If you want to default project configurations, you should do so in your user configs.
* if you want those configs verified at build time, they should be checked in to the project
* if you want to ignore the project settings and apply your own, then you configure your editor.
At least that was my train of thought implementing this. I could probably argue for the other way as well though! So keen to hear your thoughts.
…________________________________
From: Lukas Geiger <notifications@github.com>
Sent: Saturday, September 30, 2017 6:28:46 AM
To: palantir/python-language-server
Cc: Nicholas Gates; State change
Subject: Re: [palantir/python-language-server] Allow configuring pycodestyle options from the PYLS config (#146)
Thanks a lot for the super fast fix, this is awesome.
Though I feel like the config from files like setup.cfg should take precedence over the global config defined in the VSCode settings. This way people can very easily switch between projects that don't have specific pycodestyle configs (and therefor use the defaults set in the VSCode config) and still have projects with custom configs. What do you think?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<#146 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AB1rdBiOEivHycimjlOVEEgzYzbbYNvdks5snhfegaJpZM4PpPOt>.
|
|
Thanks a lot for the thorough explanation of your train of thought! I'm seeing the IDE settings as a replacement for the user configs (files in a user’s home directory) in order to give not very technical people an easy and fast way of configuring the linting behavior for projects with no custom style guide defined in a project config. Generally speaking I don't think it's a particular good thing to give people the possibility to overwrite project configs. In some cases it can eliminate the benefit of having a project config in, being that it removes the nitpicking about code style in code reviews.
linter-flake8 and prettier both use the IDE configuration only as a fallback when no project configs are found. |
|
Would you be interested in a PR implementing the behavior above? |
Fixes #144