0

shellcheck currently yields a lot of errors when analyzing one of my scripts. To get an overview I'd like to go through each error one by one. Is there a way I can disable all rules but one when using shellcheck?

Philippe
  • 1,715
  • 4
  • 25
  • 49

1 Answers1

-1

Yes, you can do this with -i/--include:

$ shellcheck --help
Usage: shellcheck [OPTIONS...] FILES...
  -i CODE1,CODE2..    --include=CODE1,CODE2..    Consider only given types of warnings

For example, to only show "SC2154: variable is referenced but not assigned":

shellcheck --include SC2154 myscript
that other guy
  • 116,971
  • 11
  • 170
  • 194