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

how to add flake8 plugins #22

Open
elisim opened this issue Sep 22, 2021 · 4 comments · Fixed by #23
Open

how to add flake8 plugins #22

elisim opened this issue Sep 22, 2021 · 4 comments · Fixed by #23

Comments

@elisim
Copy link

elisim commented Sep 22, 2021

Hi,

Thank you for the great action!
I would like to use flake8 additional plugins (e.g. pep8-naming).

How should I do it using the action?

I saw this line in the source code

await exec.exec("pip install flake8");

It seems to me that it could be inserted there, but I'm not sure.

Thank you,
Eli

@julianwachholz
Copy link
Owner

Thanks for the suggestion! The plugins can now be specified.

@elisim
Copy link
Author

elisim commented Sep 23, 2021

Thank you!

Strangely, now when running the action on pull_request, the build is passing even if the linting failed. Log:

image

My .yaml file:

# Based on https://github.com/julianwachholz/flake8-action

name: Code Quality

on:
  pull_request:
#    paths:
#      - '*.py'
    branches:
      - main
      - develop

jobs:
  lint:
    name: Python Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: "3.8"
      - name: Run flake8
        uses: julianwachholz/flake8-action@v2
        with:
          checkName: "Python Lint"
          path: .
          plugins: "pep8-naming==0.12.1 flake8-comprehensions==3.6.1"
          config: .flake8
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I took insipration from your yaml file here, and the only difference that I spot was on push (your code) whereas in mine is on pull_request.

What do you think?

BTW: consider adding in the README.md how to add multiple plugins: plugins: "pep8-naming==0.12.1 flake8-comprehensions==3.6.1"

@julianwachholz
Copy link
Owner

I will investigate! Thank you for reporting this. Maybe there are still some issues with the token somewhere?

@elisim
Copy link
Author

elisim commented Sep 26, 2021

Will check with my organization too, thanks

Edit: It seems that the token is valid, I double cheeked that.
I tried to change the trigger to push and it still not falling when flake8 outputs an error.

Did you try to run the action in a private repository? I think it might be related.
It can be done by just changing flake8-action-test repo to private to test that.

Edit2: I saw your index.js, it seems that core.setFailed(error.message); is not working for me.
I'm running on private repo. I didn't create any new secret, maybe it is the problem?

Thank you again,
Eli

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

Successfully merging a pull request may close this issue.

2 participants