GithubHelp home page GithubHelp logo

Silence specific warnings about shellcheck HOT 8 CLOSED

koalaman avatar koalaman commented on July 22, 2024
Silence specific warnings

from shellcheck.

Comments (8)

koalaman avatar koalaman commented on July 22, 2024

This is a good suggestion. Numbering error messages to allow things like this is something I've been meaning to do for quite a while.

from shellcheck.

koalaman avatar koalaman commented on July 22, 2024

Added --exclude in fbd85e9

from shellcheck.

ptman avatar ptman commented on July 22, 2024

Great. Can you give an example of using it?

from shellcheck.

koalaman avatar koalaman commented on July 22, 2024
shellcheck --exclude=SC2086,SC2035 file

There's no config file yet, but you can make it somewhat more persistent by adding an alias in .bashrc:

alias shellcheck='shellcheck --exclude=SC2086'

from shellcheck.

ptman avatar ptman commented on July 22, 2024

Ah, I see that I failed to use markdown properly when first filing this issue.

Using pylint it is possible to write the disabled checks in comments in the source, close to the location where it should take effect.

# pylint: disable-msg=C0103
a = 1  # pylint will not complain about the one character variable name

That would make this feature even more useful

from shellcheck.

koalaman avatar koalaman commented on July 22, 2024

I tried finding some docs on how this is scoped, but couldn't and I don't want to try it and see. Does pylint does this per line, per structure or per file?

from shellcheck.

ptman avatar ptman commented on July 22, 2024

I believe it is scoped by python's scope. A # pylint: -line at the start of a method affects that method. One at the start of a file affects that file.

But even whole-file scoped would help compared to having to use command aliases (or Makefiles).

from shellcheck.

koalaman avatar koalaman commented on July 22, 2024

I added #43 for this functionality.

from shellcheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.