-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Linting Entire Projects #3599
Comments
The `ale_lsp_root` setting is now deprecated, and `ale_root` should be used instead. The setting will be used for both setting the root easily for LSP linters, and for running other linters over whole projects.
I've added the |
Given that ALE is a plugin inside an editor, I feel it would be very weird for it to operate on other files. I definitely never want to know about issues on files different than the one I'm working on. The performance cost sounds like it would be non-negligible too. This kind of functionality, IMHO, fits in better in things like |
This would be helpful for statically typed languages like TypeScript or Elm, where if you are making wide changes, you really want to get a sense of whether the entire project is in a good state before you attempt to run your code. The present alternative is to go through your files and save them one by one, checking for type errors, which is cumbersome. So I would find this functionality useful. Knowing that this would be an opt-in, on-demand feature is nice. |
A massive +1 here. I use ALE mostly for Rubocop, and it's great that it shows me the offences inline. However, especially when working with projects that don't fully lint, I'd like to get all the offences, load them in the quickfix list, and go through them one by one to see whether I have something fix quickly (pun not intended). Right now I just end up running rubocop piped to a file and then I load it with I actually started using neomake for that, but it has its troubles (getting rubocop to run with bundler, for example, is challenging; also no status indicators). Adding a |
@WhyNotHugo You'll never know the feature is there if you don't use |
I'm going to close this issue, as I have decided against it, because there's a much better solution I will work on in future. It is this: https://github.com/w0rp/report-alchemy I won't say too much about that project, and I won't start on it probably any time soon, but here is my thinking.
As that little guy in The Mandalorian says, "I have spoken." |
To add a little more. I think it would be a great shame to complicate ALE's code with a totally different way of looking at projects. Shoving in "project wide linting" support would make it harder to maintain the simple "lint as you type" behaviour that ALE is good at. By keeping things separated, people will get a better experience all around later. |
ALE has been focused on linting a single file at a type as you type for a long time. The functionality of ALE for doing this has been working so well for my personal work that I haven't felt the need to add much of anything to ALE for about half a year: it does what I want and I don't want much else. I've been thinking of something I would like to see in ALE, and that's an issue that came up a long time ago: Linting entire projects. (The earliest issue I could find is #669, and the most recent is #3524.)
It's possible to add functionality to ALE for linting an entire project, provided the following restrictions are applied.
project_command
option defined for it, optionallyproject_root
.cwd
for the command for running against the project will be set to the project root. A newale_root
option will deprecate and replace theale_lsp_root
option, and function in exactly the same manner, but for linters that check entire projects.loclist
instead. You cannot populate local errors in the quickfix list at the same time that you're populating the quifckfix list with project-wide errors.callback
functions will be discarded when running over a whole project if they are lacking thebufnr
orfilename
keys.ALELintProject
command, never automatically.As a pre-requisite for this work, #2281 will have to be implemented first, so the working directory for commands can be separated from the commands, such that the working directory can be swapped out when running against an entire project.
The
project_command
option implies that some linters will have_project_options
settings, in addition to_options
, so separate arguments can be set when checking entire projects. I know I personally use two different ESLint configuration files for checking individual files and projects, because the full type-aware configuration is too slow.The support table will have to be updated to indicate which linters support checking an entire project. They won't all support it overnight. ESLint will probably be the first linter that gets this kind of support just because I happen to use it.
The text was updated successfully, but these errors were encountered: