Giter Club home page Giter Club logo

Comments (6)

rhysd avatar rhysd commented on June 8, 2024

It's intentional. When you have ~/.shellcheckrc in your local, it affects actionlint behavior in your local (and it will behave differently on CI). Such side effect should be avoided as much as possible.

What do you need to configure by .shellcheckrc file?

from actionlint.

piotrekkr avatar piotrekkr commented on June 8, 2024

@rhysd I wanted to disable this one error SC2129. As you can see on screenshot it is a style suggestion and would be nice if I could not be forced to fix this if this is not real issue. In general would be nice to be able to configure instead of only disabling whole shellcheck. We plan to use .shellcheckrc in project directory so no real issue there if it is in GIT.

image

from actionlint.

rhysd avatar rhysd commented on June 8, 2024

Thank you for sharing your motivation. I'll consider how to meet the requirement.

from actionlint.

rhysd avatar rhysd commented on June 8, 2024

@piotrekkr It seems that passing arguments via SHELLCHECK_OPTS variable can be a solution for this.

SHELLCHECK_OPTS='-e SC2129' actionlint

(Related to #258)

from actionlint.

ericcornelissen avatar ericcornelissen commented on June 8, 2024

It's intentional. When you have ~/.shellcheckrc in your local, it affects actionlint behavior in your local (and it will behave differently on CI). Such side effect should be avoided as much as possible.

This clarifies a lot for me, coming from #258. At least for me, I would like actionlint to utilize the .shellcheckrc configuration I have for the project I'm running it against - I agree that it's undesirable to use ~/.shellcheckrc for the reason you point out.

While using the SHELLCHECK_OPTS environment variable is a viable workaround, perhaps a long term solution would be for actionlint to (perhaps optionally) use, if present, the .shellcheckrc file in the working directory where actionlint is invoked (or actionlint could even accept the location of the .shellcheckrc file as an argument). I don't think shellcheck currently supports this use case, but there is an open issue for it: koalaman/shellcheck#1879

The primary reason I think this would be a better solution is because it can help avoid duplication of the ShellCheck configuration, what do you think @rhysd?

from actionlint.

piotrekkr avatar piotrekkr commented on June 8, 2024

@rhysd Yeah this could work if we did not use devops-actions/actionlint for linting.

  run-actionlint:
    name: Run actionlint
    runs-on: ubuntu-22.04
    timeout-minutes: 3
    steps:
      - name: Checkout app code
        uses: actions/checkout@v4
        with:
          persist-credentials: false
          show-progress: false

      - name: Run actionlint
        uses: devops-actions/[email protected]

It is wrapper around this tool. There seems to be no way to pass this env there. I'll create ticket in their repo about adding this somehow (maybe as input or to just pass env to docker). Anyway, thanks for your help. Will close this one.

from actionlint.

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.