Giter Site home page Giter Site logo

ShellCheck about forkrun HOT 3 CLOSED

Dmole avatar Dmole commented on May 26, 2024
ShellCheck

from forkrun.

Comments (3)

jkool702 avatar jkool702 commented on May 26, 2024

Yes, ShellCheck was used (fairly extensively) as I was writing forkrun.

All the shellcheck warnings shown fall into one of four categories:

  1. stylistic choices. notably, [SC2004](https://www.shellcheck.net/wiki/SC2004) (style): $/${} is unnecessary on arithmetic variables.
  2. shellcheck not being advanced enough to understand the code. In particular the few places that forkrun d namically generates code qand then sources it give it trouble. notably [SC1090](https://www.shellcheck.net/wiki/SC1090) (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.. The [SC2034](https://www.shellcheck.net/wiki/SC2034) (warning): <variable> appears unused. Verify use (or export if used externally). warnings directly stem from that as well.
  3. What shellcheck is warning about is intentional behavior. Notably [SC2016](https://www.shellcheck.net/wiki/SC2016) (info): Expressions don't expand in single quotes, use double quotes for that.
  4. What shellcheck is warning about can never occur and thus isnt a problem. This includes warnings like [SC2162](https://www.shellcheck.net/wiki/SC2162) (info): read without -r will mangle backslashes. when what is being read is guaranteed to be just a number without spaces/backslashes/anything other than digits.

I could safely disable SC2004 and SC1090, as these particular rules can always be safely ignored, but the rest are cases where in that specific situation the rule doesnt apply, not cases where the rule should unilaterally never apply, so I wouldnt want to disable those.

from forkrun.

Dmole avatar Dmole commented on May 26, 2024

If you want you can just add a comment like

# shellcheck disable=SC2016

And it will only impact the following line/block

(Having zero warnings is the easiest way to notice when a new unintentional warning occurs)

from forkrun.

jkool702 avatar jkool702 commented on May 26, 2024

I just pushed a update to the main branch that bumps the version to forkrun v1.1. The main new feature is support for splitting up stdin based on the number of bytes read (supported by 2 new flags: -b and -B), but one of the smaller miscellaneous changers was to globally disable many of the not-really-useful/applicable shellcheck warnings.

I havent gone through and line-by-line disabled the 20 or so shellcheck warnings that are useful warnings in general but dont apply to that specific line. At some point once forkrun is more-or-less "stable and complete" and not still having new features actively developed Ill probably add these line-by-line shellcheck disable directives.

Im going to go ahead and close this issue. Thanks for taking the time to submit it!

from forkrun.

Related Issues (1)

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.