wemake-services / wemake-python-styleguide

The strictest and most opinionated python linter ever!
https://wemake-python-styleguide.rtfd.io
MIT License
2.53k stars 378 forks source link

GitHub Action silently failing #2436

Closed edmondop closed 2 years ago

edmondop commented 2 years ago

What's wrong

I am running wemake-python-styleguide GitHub action and it silently fails with an exception

      - name: wemake-python-styleguide
        uses: wemake-services/wemake-python-styleguide@0.15.3
        with:
          reporter: 'github-pr-check'
        env:
          GITHUB_TOKEN: ${{ secrets.github_token }}

The action fails like so:

Run wemake-services/wemake-python-styleguide@0.15.3
/usr/bin/docker run --name e0ead[9](https://github.com/edmondo1984/pylib-template/runs/7044500691?check_suite_focus=true#step:8:10)1df91bf4aedb4076d890c465a45_26544d --label 72882e --workdir /github/workspace --rm -e pythonLocation -e LD_LIBRARY_PATH -e GITHUB_TOKEN -e INPUT_REPORTER -e INPUT_PATH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/pylib-template/pylib-template":"/github/workspace" 72882e:0ead91df91bf4aedb4076d890c465a45  "." "github-pr-check"
Using reporter: github-pr-check
Linting path: .
flake8 --version:
3.9.2 (flake8-bandit: 2.1.2, flake8-broken-line: 0.3.0, flake8-bugbear:
21.11.29, flake8-comprehensions: 3.[10](https://github.com/edmondo1984/pylib-template/runs/7044500691?check_suite_focus=true#step:8:11).0, flake8-darglint: 1.8.1,
flake8-debugger: 4.1.2, flake8-docstrings: 1.6.0, pydocstyle: 6.1.1,
flake8-eradicate: 1.2.1, flake8-string-format: 0.3.0, flake8_commas: 2.1.0,
flake8_isort: 4.1.1, flake8_quotes: 3.3.1, mccabe: 0.6.1, naming: 0.[11](https://github.com/edmondo1984/pylib-template/runs/7044500691?check_suite_focus=true#step:8:12).1,
pycodestyle: 2.7.0, pyflakes: 2.3.1, rst-docstrings: 0.2.6,
wemake_python_styleguide: 0.15.3) CPython 3.9.5 on Linux
=================================
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line [12](https://github.com/edmondo1984/pylib-template/runs/7044500691?check_suite_focus=true#step:8:13)5, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/usr/local/lib/python3.9/site-packages/flake8/checker.py", line 676, in _run_checks
    return checker.run_checks()
  File "/usr/local/lib/python3.9/site-packages/flake8/checker.py", line 589, in run_checks
    self.run_ast_checks()
  File "/usr/local/lib/python3.9/site-packages/flake8/checker.py", line 494, in run_ast_checks
    for (line_number, offset, text, _) in runner:
  File "/usr/local/lib/python3.9/site-packages/flake8_bandit.py", line 85, in run
    for warn in self._check_source():
  File "/usr/local/lib/python3.9/site-packages/flake8_bandit.py", line 59, in _check_source
    bnv = BanditNodeVisitor(
TypeError: __init__() missing 1 required positional argument: 'metrics'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/usr/local/lib/python3.9/site-packages/flake8/main/application.py", line 363, in run
    self._run(argv)
  File "/usr/local/lib/python3.9/site-packages/flake8/main/application.py", line 351, in _run
    self.run_checks()
  File "/usr/local/lib/python3.9/site-packages/flake8/main/application.py", line 264, in run_checks
    self.file_checker_manager.run()
  File "/usr/local/lib/python3.9/site-packages/flake8/checker.py", line 3[21](https://github.com/edmondo1984/pylib-template/runs/7044500691?check_suite_focus=true#step:8:22), in run
    self.run_parallel()
  File "/usr/local/lib/python3.9/site-packages/flake8/checker.py", line [28](https://github.com/edmondo1984/pylib-template/runs/7044500691?check_suite_focus=true#step:8:29)7, in run_parallel
    for ret in pool_map:
  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 448, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 870, in next
    raise value
TypeError: __init__() missing 1 required positional argument: 'metrics'
reviewdog: failed to run 'git rev-parse --show-prefix': exit status 128
=================================

How it should be

The action should fail

Flake8 version and plugins

Using the action

pip information

Using the action

OS information

ubuntu-latest on GitHub

sobolevn commented 2 years ago

This is a known problem. bandit and flake8-bandit were broken at some point. Please, use https://github.com/wemake-services/wemake-python-styleguide/releases/tag/0.16.1