-
Notifications
You must be signed in to change notification settings - Fork 16
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
set project_root where the config file may be #53
set project_root where the config file may be #53
Conversation
Well, dear Sir, there seems to be a bit of duplication in the |
I'd like to point out that there should be a way for the user to override this behavior. |
@FichteFoll adding the "working_dir" to the settings file seems to override it. Is that what you're referring too? |
The But enumerating a lot of possible names just leads to false matches. It might be better to look for few, 100% names and that is surely not .git because we still fall-back to what we currently have if nothing else (or better) can be found. 🤔 |
@kaste thanks! for my side, I don't understand what you want me to change? Are you suggesting to remove the .git match line? Personally I think its useful to make the function return faster, even if sublime will do something similar. Its the same pattern logic that isort and black are using to find a project settings file. |
I don't suggest anything, I just speak out loud what we're doing here. What are actually the pros and cons? Is it better to have a lot of Why is having ".git" in there faster btw? Anyway, when you have 6 same conditionals you have a for loop. And you have a class variable probably defining "names" to look for. That's on the implementation side. |
👍🏽 .git is generally at the project root so hitting this will stop and further checks. |
Fixes #1883 Fixes SublimeLinter/SublimeLinter-pylint#57 Closes SublimeLinter/SublimeLinter-mypy#53 Closes SublimeLinter/SublimeLinter-pylint#66 Ref #1890 - Detect the typical name "venv" as a virtual environment candidate - Search for typical files/names and set `project_root` accordingly. This will in turn affect the `working_dir` we use unless overridden by the user.
Fixes #1883 Fixes SublimeLinter/SublimeLinter-pylint#57 Closes SublimeLinter/SublimeLinter-mypy#53 Closes SublimeLinter/SublimeLinter-pylint#66 Ref #1890 - Detect the typical name "venv" as a virtual environment candidate - Search for typical files/names and set `project_root` accordingly. This will in turn affect the `working_dir` we use unless overridden by the user.
Set the project root to be where a config file is found, otherwise set it to the project root... if no root, then set to where the file is and let mypy search for the config.