title: How to suppress irrelevant ShellCheck messages?
body: <h2>Environment</h2>
  <p>System: Linux Mint 19 (based on Ubuntu 18.04).</p>
  <p>Editor: I use <a href="https://softwarerecs.stackexchange.com/a/50898/33363"><strong>Visual Studio Code</strong></a> (<a href="https://code.visualstudio.com/" rel="noreferrer">official website</a>) with ShellCheck plugin to check for errors, warnings, and hints on-the-fly.</p>
  <hr />
  <h2>ShellCheck</h2>
  <p>is a necessary tool for every shell script writer.</p>
  <p>Although the developers must have put enormous effort to make it as good as it gets, it sometimes produces irrelevant warnings and / or information.</p>
  <p>Example code, with such messages (warning <a href="https://github.com/koalaman/shellcheck/wiki/SC2120" rel="noreferrer">SC2120</a> + directly adjacent information <a href="https://github.com/koalaman/shellcheck/wiki/SC2119" rel="noreferrer">SC2119</a>):</p>
  <hr />
  <h2>Example shell script snippet</h2>
  <pre><code>am_i_root ()
  # expected arguments: none
  {
      # check if no argument has been passed
      [ &quot;$#&quot; -eq 0 ] || print_error_and_exit &quot;am_i_root&quot; &quot;Some arguments have been passed to the function! No arguments expected. Passed: $*&quot;
  
      # check if the user is root
      # this will return an exit code of the command itself directly
      [ &quot;$(id -u)&quot; -eq 0 ]
  }
  
  # check if the user had by any chance run the script with root privileges and if so, quit
  am_i_root &amp;&amp; print_error_and_exit &quot;am_i_root&quot; &quot;This script should not be run as root! Quitting to shell.&quot;
  </code></pre>
  <hr />
  <p>Where:</p>
  <ul>
  <li><p><code>am_i_root</code> is checking for unwanted arguments passed. Its real purpose is self-explanatory.</p>
  </li>
  <li><p><code>print_error_and_exit</code> is doing as its name says, it is more or less self-explanatory.</p>
  </li>
  <li><p>If any argument has been passed, I want the function / script to print error message and exit.</p>
  </li>
  </ul>
  <hr />
  <h2>Question</h2>
  <p>How do I disable these messages (locally only)?</p>