cmake_format icon indicating copy to clipboard operation
cmake_format copied to clipboard

cmake-lint: disable not working as expected?

Open berthin opened this issue 1 year ago • 1 comments

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

berthin avatar Oct 04 '23 17:10 berthin

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...

stefanct avatar Apr 15 '24 12:04 stefanct