cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
962 stars 105 forks source link

Linter: filter lint checks #255

Open ner0-m opened 3 years ago

ner0-m commented 3 years ago

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 :^)

cheshirekow commented 3 years ago

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

meinzer1899 commented 1 year ago

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