Skip to content
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

New cppcheck versions do not work when used with compile_commands.json #4854

Open
matrdr opened this issue Nov 3, 2024 · 0 comments
Open
Labels

Comments

@matrdr
Copy link

matrdr commented Nov 3, 2024

Information

VIM version

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Sep 25 2024 10:13:04)
Included patches: 1-16, 647, 678, 697

Operating System:
Xubuntu 22.04

What went wrong

When I add a compile_commands.json file to the project, ALE correctly detects this and uses cppcheck's ability to read this file by passing it to its --project option.

The release notes of version 2.13 (https://github.com/danmar/cppcheck/releases/tag/2.13.0) of cppcheck include the following entry:

--project can also no longer be used in conjunction with additional source files.

Unfortunately, this is, what ALE does. This is the resulting :AleInfo:

(finished - exit code 1) ['/bin/bash', '-c', 'cd ''/home/matthias/dev/c-lsp-test'' && ''cppcheck'' -q --language=c --template=''{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}'' --project=''build/compile_commands.json'' --file-filter=''test/test.c'' --enable=style ''/tmp/vaX
Frmt/2/test.c''']
<<<OUTPUT STARTS>>>
cppcheck: error: --project cannot be used in conjunction with source files.
<<<OUTPUT ENDS>>>

Reproducing the bug

  1. Have a cppcheck version >2.13
  2. Have a compile_commands.json file in your project

Workaround

Removing line 19 in ale_linters/c/cppcheck.vim (the %t in the command) seems to fix this issue. But I guess it would break it for projects that do not have a compile_commands.json file.

@matrdr matrdr added the bug label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant