dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.57k stars 1.44k forks source link

Fix #4251 --file-filter option removed for cppcheck handler #4639

Open juanmitaboada opened 1 year ago

juanmitaboada commented 1 year ago

--file-filter option has been removed because using it prevents cppcheck from processing the file if it is in a different path

w0rp commented 1 year ago

I'll have to have a think about this before I merge it. It's probably right.

w0rp commented 11 months ago

Projects often have a structure such as src/*.cpp for all source files. Running cppcheck on the entire directly could be slow without a file filter, which I belive is the reason the filter is in place. I think the solution the problem here is the following:

  1. Edit the linter so it runs in a specific cwd.
  2. Keep --filte-filter and so it to a path relative to the cwd that was selected for the linter.

ALE has functions in ale#path that can be used for this purpose. You can do that and update the tests to test for it.

Thanks for looking into this!

stale[bot] commented 8 months ago

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests. If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.