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

cmake-lint: disable not working as expected? #332

Open
berthin opened this issue Oct 4, 2023 · 1 comment
Open

cmake-lint: disable not working as expected? #332

berthin opened this issue Oct 4, 2023 · 1 comment

Comments

@berthin
Copy link

berthin commented Oct 4, 2023

Hi,

The following cmake command

add_custom_target(list-all COMMAND echo cmake build target: ${_all_targets})

triggers the C0113 error as:

Missing COMMENT in statement which allows it

and I wanted to suppress that error by adding the "cmake-lint: disable" statement as

# cmake-lint: disable=C0113
add_custom_target(list-all COMMAND echo cmake build target: ${_all_targets})

but still I get the error when I run cmake-lint. How could that be wrong?

for ref:

$ cmake --version
cmake version 3.26.4

$ cmake-lint --version
0.6.13
@stefanct
Copy link

I haven't looked at the code but it works if the command has line breaks, e.g.:

# cmake-lint: disable=C0113
add_custom_target(list_all
    COMMAND "echo cmake build target"
)

Another possible issue (that I am currently facing) is that multiple disables in one file don't seem work. This is somewhat documented but still...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants