cmake_format icon indicating copy to clipboard operation
cmake_format copied to clipboard

Linter: filter lint checks

Open ner0-m opened this issue 3 years ago • 2 comments

Hi, thanks for the awesome tool, I'm a big fan.

I thought it would be a very nice feature to selectively enable and/or disable certain lint codes. Maybe that's already possible in same way, but I couldn't figure out how (please enlighten me if so).

Use case:

I'm currently trying to get a project to follow a certain style guide. But for now, I'm concentrating on a subset of the checks. So currently, running the linter is still quite noisy (e.g I'm getting a lot of bad indentation and trailing white space warnings, which I don't want to deal with right now). That can make it harder to spot the things I'm currently trying to clean up or prevent from getting back in.

I think, it would be super helpful for me, to be able to run something along the lines fd "cmake$|CMakeLists.txt" -x cmake-format --lint-codes="C0103", then I get all the places I use the wrong variable or function names.

Just an idea :^)

ner0-m avatar May 17 '21 13:05 ner0-m

I think you are looking for the option called disabled_codes (documentation here)

cheshirekow avatar May 17 '21 15:05 cheshirekow

This issue here also helps: https://github.com/cheshirekow/cmake_format/issues/209

meinzer1899 avatar Nov 15 '22 13:11 meinzer1899