Disable all shellcheck messages for part of file
I like to use shellcheck to check my bashrc. However, over half of the code in there is auto-generated by the system and there are a lot of warnings. Is there a way to disable all shellcheck messages for the auto-generated part of the file and then re-enable all of them for the part I want? Perhaps something like this:
#!/bin/bash
# shellcheck disable *
# auto-generated stuff ...
# shellcheck enable *
# my configuration ...
Isn't the following (with a shellcheck version >= 0.7.2):
# shellcheck disable=SC1000-SC9999
..from https://github.com/koalaman/shellcheck/issues/2252#issuecomment-886981920 a usable workaround for the missing shellcheck disable *?
For re-enabling you'd have to be painfully explicit if you do not want some of the rules though... :disappointed:
https://github.com/koalaman/shellcheck/wiki/Directive#disable disable only silence the error, but parsing still stops at the same point, so no way to enable back the parsing afterward, it has stopped.