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

Unrecognized Arguments #78

Closed
seyyedaliayati opened this issue Aug 9, 2021 · 3 comments
Closed

Unrecognized Arguments #78

seyyedaliayati opened this issue Aug 9, 2021 · 3 comments

Comments

@seyyedaliayati
Copy link

I didn't set path like the default configuration but I got this error:

/opt/hostedtoolcache/Python/3.8.11/x64/bin/flake8 --ignore F403,F405, W503, W504 --exclude */migrations/* --max-line-length 120 .
usage: flake8 [options] file file ...
flake8: error: unrecognized arguments: .
Error: ERROR: Action failed during execution with error: The process '/opt/hostedtoolcache/Python/3.8.11/x64/bin/flake8' failed with exit code 2

Here is my yml file:

name: flake8 Lint # https://github.com/marketplace/actions/python-flake8-lint

on: [push, pull_request]

jobs:
  flake8-lint:
    runs-on: ubuntu-latest
    name: Lint
    steps:
      - name: Check out source repository
        uses: actions/checkout@v2
      - name: Set up Python environment
        uses: actions/setup-python@v1
        with:
          python-version: "3.8"
      - name: flake8 Lint
        uses: py-actions/flake8@v1
        with:
          max-line-length: "120"
          exclude: "*/migrations/*"
          ignore: "F403,F405, W503, W504"
@chrissimpkins
Copy link
Contributor

I think that it is the spaces in the ignore list. Try removing all spaces inside the quotes

@mdcsaenz
Copy link

mdcsaenz commented Aug 12, 2021

I had the same issue and I didnt have any spaces

name: flake8 Lint # https://github.com/marketplace/actions/python-flake8-lint
on: [push, pull_request]
jobs:
    flake8-lint:
      runs-on: ubuntu-latest
      steps:
        - name: Check out source repository
          uses: actions/checkout@v2
        - name: Set up Python environment
          uses: actions/setup-python@v1
          with:
            python-version: "3.8"
        - name: flake8 Lint
          uses: py-actions/flake8@v1

@chrissimpkins
Copy link
Contributor

I can reproduce the OP error locally when the spaces are present in the ignore option definitions. It is eliminated when I remove the spaces (here with an existing local dir):

flake8 --ignore F403,F405,W503,W504 --exclude target --max-line-length 120 .

I think that removal of the spaces between the warning and fail codes should address your issue.

For @mdcsaenz issue, will you please post the error message that you receive when you execute that workflow?

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