Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed: some errors message, problems with the filter and spaghetti code #13

Closed
lucasvazq opened this issue Jul 15, 2020 · 3 comments

Comments

@lucasvazq
Copy link

lucasvazq commented Jul 15, 2020

Hi, I am having a couple of issues with using this action and I would like to receive help.

1) The first thing is that a warning message is being displayed when I use it. I would like to know if this is completely normal or is it a bug?

2020-07-15-183658_956x234_scrot

2) The second thing is, I'd like to know how I can run shellcheck over my entire file, rather than just the diff.
I have tried using the filter_mode: nofilter and filter_mode: file parameters but they were not successful (it may be due to the previous error)

The same message for both was:
2020-07-15-183708_636x39_scrot

3) And finally, I have spaghetti code in my action because I want to run shellcheck against a lot of different files that don't have any similitude in the name, is there any solution for it?

Here is my action:

name: Linter [develop]

on:
  pull_request:
    branches:
      - develop

jobs:
  linter:
    name: Linter
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Super-Linter
        uses: github/[email protected]
        env:
          VALIDATE_ALL_CODEBASE: false

      # Spaghetti code

      - name: shellcheck for ~/.zshrc
        uses: reviewdog/[email protected]
        with:
          pattern: ".zshrc"
          github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
          filter_mode: file
          shellcheck_flags: '-s sh -e 1090,2004,2039'

      - name: shellcheck for ~/.local/bin/change-background
        uses: reviewdog/[email protected]
        with:
          pattern: "change-background"
          github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
          filter_mode: file
          shellcheck_flags: '-s sh -e 1090,2004,2039'

      - name: shellcheck for ~/.local/bin/start-script
        uses: reviewdog/[email protected]
        with:
          pattern: "start-script"
          github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
          filter_mode: file
          shellcheck_flags: '-s sh -e 1090,2004,2039'

Thanks for your time ⭐

@Vlaaaaaaad
Copy link

@lucasvazq it's likely a version mismatch.

You are using the v1.0.0 version of reviewdog/action-shellcheck. That's pretty old. Could you use the latest version( v1.3.0) and report back?

The shellcheck_flags parameter that you are using was added in v1.2.1 for example: https://github.com/reviewdog/action-shellcheck/releases/tag/v1.2.1

@shogo82148
Copy link
Contributor

We recommend you to use @v1 tag, because of reviewdog/action-template#11

GitHub Marketplace says that the latest version is v1.0.0.
image

but, actually, the latest version of action-shellcheck is v1.3.0.

@lucasvazq
Copy link
Author

lucasvazq commented Jul 16, 2020

Thanks to both @Vlaaaaaaad @shogo82148
I have updated the version and now its works for me

Here is how my action looks

name: Linter [develop]

on:
  pull_request:
    branches:
      - develop

jobs:
  linter:
    name: Linter
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Super-Linter
        uses: github/[email protected]
        env:
          VALIDATE_ALL_CODEBASE: false
          VALIDATE_BASH: false

      - name: shellcheck for ~/.zshrc
        uses: reviewdog/[email protected]
        with:
          pattern: ".zshrc"
          github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
          filter_mode: nofilter
          shellcheck_flags: "-s sh -e 1090,1091,2004,2039"

      - name: shellcheck for ~/.local/bin/change-background
        uses: reviewdog/[email protected]
        with:
          pattern: "change-background"
          github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
          filter_mode: nofilter
          shellcheck_flags: "-s sh -e 1090,1091,2004,2039"

      - name: shellcheck for ~/.local/bin/start-script
        uses: reviewdog/[email protected]
        with:
          pattern: "start-script"
          github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
          filter_mode: nofilter
          shellcheck_flags: "-s sh -e 1090,1091,2004,2039"

I'm going to close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants