-
Notifications
You must be signed in to change notification settings - Fork 178
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
Use project path as cwd if present #127
Conversation
See AtomLinter/linter-pylint#8 for motivation for this. It's helpful to use the project root for Python linting at least. I suspect it would be useful more generally too. Feel free to close this request if you disagree. Test Plan: Crossed fingers
#5 related code |
It seems to me that the a good number of tools search up your file tree for the project config file. Doing it from root doesn't seem correct for single file linting, which is the primary set of supported linters. However, the cwd is modifiable by individual linters. I have a project I'm working on where I actually update this to be the project path because the "linter" requires full project knowledge in order to operate properly. I assume this is the case in pylint. Should probably just override in the linters where this matters. I would just pull AtomLinter/linter-pylint#8. |
Linters that only care about a single file probably ignore the cwd anyway, so I think this is a better default. Also, as a linter author the 'current working directory' being a subdirectory of Atom's cwd/project dir is surprising. |
Closing this since it seems that others are not convinced it's useful. |
Hey @park9140, I'm reopening this since it would have helped out with AtomLinter/linter-csslint#8 for example. Here's a demonstration for why this is a better default:
Above you can see that on the command line your cwd is determined by your context.
But in AtomLinter, we ignore your context and always set the cwd to the basename of the path being linted. I think it's beneficial to be consistent with the command line usage. This is what lint executable authors will be designing for. We're doing something different for no good reason. What benefit do we get by overriding the cwd like this? |
It seems like the large majority of linters seem to implement this as the default now. There are a few like tslint, and jshint that will need to be modified when this change goes in to maintain the existing functionality. |
Yeah, auditing existing linters is going to be a pain. I'll definitely hold off until I can do that. |
See AtomLinter/linter-pylint#8 for motivation for this.
It's helpful to use the project root for Python linting at least. I suspect it
would be useful more generally too.
Feel free to close this request if you disagree.
Test Plan:
Crossed fingers