-
Notifications
You must be signed in to change notification settings - Fork 37
Create new config option 'config_names' #42
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
3f552f0
to
f87b0f0
Compare
Given that the search for the config file only goes upwards, I can see why people might want this. Can you name examples of people placing the configs in subdirectories? I have never heard of that practice. However, what you are presenting is somewhat two features merged into one: |
So I think it can be fairly common pattern for many IDEs. For example, Visual Studio Code places workspace settings in a From personal experience I also find this becomes much more desirable on big projects that pull from upstream maintainers and have many developers working on them simultaneously as it keeps things much neater, even allowing a reasonable place for per developer configs. And I think this practice is becoming more common in general, for example with Linux distros increasingly encouraging tools to place their configurations in |
Now in terms of separating the features. I think the intention for the However, it feels like trying to separate these into two separate "base config file name" and "relative config directory" settings is actually going to make the scheme more confusing in terms of explaining the usage patterns to users of the plugin. It would also complicate the implementation code since we already get directories included for free. That's my personal opinion, however I don't mind how it's represented to the user. What's important for me is that as the plugin searches up the directory tree for configurations that it can check not only custom files names but that those file names can live in custom sub-directories. |
I see. |
@Richardk2n : Yes, I did intend to check for these custom paths while directories are scanned all the way up. If putting the configuration in a subdirectory inside the workspace makes sense, I think it also makes sense for this to be possible higher up (for example once you reach the user's home directory). Putting configurations inside subdirectories does appear to be increasingly encouraged. I think as long as this behaviour is well documented it won't be particularly confusing, though ultimately you'll have to decide if you're comfortable with that or not. I need to make sure I understand what you mean by working directory. Do you mean specifying a custom config file path relative to the workspace root? I think this would be enough for what I'm currently doing (though I have to admit I don't know how pylsp actually determines the location of the workspace root, and it does feel a bit less flexible). Additionally it would be nice if one could specify a custom search path relative to the user's HOME directory as well, though just having support for the various default search locations that mypy itself provides would be sufficient. Let me know how you'd like to proceed and I can work on the code if you like. |
Just for clarity: |
This configuration option allows us to specify additional configuration file names under which the mypy config could be found.
I renamed the feature and took the liberty to change some implementation details. Does this work for you? |
I looked over the code and I think this should be sufficient to cover my use case. I won't get a chance to test it out for a couple of weeks though but I'll report back when I do. |
This configuration option allows us to specify additional configuration file names under which the mypy config could be found.
This is intended to be a draft. Happy to work out details further as necessary.