Skip to content

How to configure wiki link count via .shellcheckrc configuration file? #3434

@mcandre

Description

@mcandre

Hi,

I am trying to optimize logs, removing extended descriptions of the rule sets. That way, the results will be more focused, like reports of similar linters.

When recursively scanning large projects, then the links introduce a lot of noise. And duplication.

I see that the CLI supports a flag --wiki-link-count=<n> to tune this behavior. And the CLI flag works.

However, carrying around CLI flags between projects adds complexity. So I am trying to configure this behavior with the .shellcheckrc file. This does not work.

Trace:

% cat .shellcheckrc 
disable=SC1090,SC2034,SC2044,SC2128,SC2148,SC2154,SC2163,SC2164,SC2206,SC2296,SC2317,SC2329
wiki-link-count=0

% shellcheck docker/freebsd/bin/rocklet

In docker/freebsd/bin/rocklet line 144:
export metrics_b="$(du -sb "$source_media" | awk '{ print $1 }')"
       ^-------^ SC2155 (warning): Declare and assign separately to avoid masking return values.


In docker/freebsd/bin/rocklet line 159:
        directories="${directories}\"/$f\": y,"
                                   ^-^ SC2089 (warning): Quotes/backslashes will be treated literally. Use an array.


In docker/freebsd/bin/rocklet line 162:
        checksums="${checksums}\"/${f}\": \"$checksum\","
                               ^-^ SC2089 (warning): Quotes/backslashes will be treated literally. Use an array.


In docker/freebsd/bin/rocklet line 169:
export directories
       ^---------^ SC2090 (warning): Quotes/backslashes in this variable will not be respected.


In docker/freebsd/bin/rocklet line 170:
export checksums
       ^-------^ SC2090 (warning): Quotes/backslashes in this variable will not be respected.

For more information:
  https://www.shellcheck.net/wiki/SC2089 -- Quotes/backslashes will be treate...
  https://www.shellcheck.net/wiki/SC2090 -- Quotes/backslashes in this variab...
  https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...

% shellcheck --version
ShellCheck - shell script analysis tool
version: 0.11.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net

Borrowed the configuration line from https://android.googlesource.com/platform/external/mesa3d/+/3d7d303dc5287ceddd9dea2e9a2ca0b9802a419e/.shellcheckrc

The disable setting in .shellcheckrc works well. But for some reason, wiki-link-count does not.

I don't see the syntax for this documented anywhere in first party instructions.

Have I made a typo?

Can we please make sure that 100% of the parameters are available to be set by IaC friendly .shellcheckrc files?

There also appears to be an extraneous newline at the very beginning of ShellCheck output, unlike how other CLI applications behave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions