Reputation: 5029
Currently, if I run :SyntasticCheck
, :Errors
displays errors for the current buffer only. What I want it to do is to check all Python (*.py
) files in the current working directory, and so that all the locations are aggregated in a single LocationList.
I know this is possible because the Syntastic documentation implies it, e.g. there is a syntastic_ignore_files
setting for ignoring patterns of filenames.
My failed attempt:
let g:syntastic_aggregate_errors = 1
*.py
files with :n *.py
:bufdo SyntasticCheck
:Errors
shows errors only for the last buffer that was checked.Upvotes: 2
Views: 496
Reputation: 11
Vim supports errorfiles, so if your underlying checker can output a list of errors in the format expected by Vim, just run vim -q [errorfile]
and the quickfix list will be populated with all the errors. You can cycle through the locations in the quickfix list (e.g. using :cn
) and Vim will open the corresponding files for you as you go.
Upvotes: 1
Reputation: 5861
Currently, if I run
:SyntasticCheck
,:Errors
displays errors for the current buffer only. What I want it to do is to check all Python (*.py
) files in the current working directory, and so that all the locations are aggregated in a single LocationList.
This is not possible, and there is currently no plan to implement it.
I know this is possible because the Syntastic documentation implies it, e.g. there is a
syntastic_ignore_files
setting for ignoring patterns of filenames.
Some checkers check include files and the like, and sometimes you may not care about errors there. Also, there are situations when you don't want to check certain files automatically (this is generally useful when you have active mode enabled).
let g:syntastic_aggregate_errors = 1
This aggregates errors when running different checkers against the same file. It doesn't aggregate errors when running the same checker against a set of files.
It cycles through each buffer and runs the check. However, when this is finished
:Errors
shows errors only for the last buffer that was checked.
Yes, :Errors
shows the error window for the current buffer.
You might set g:syntastic_check_on_open
and active mode and open the files in separate windows. That would run checks against all files, but the results would still be per file, not global. And window positions would be screwed up because of limitations in Vim's API. Basically, there is no way to do what you want if the checker you're running doesn't already check all files by itself.
Upvotes: 2