Skip to content
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Action that finds Python 3 syntax errors and undefined names

A GitHub Action that runs selected flake8 tests on the Python code in your repo. If there are syntax errors or undefined names found in your Python code then this Action will fail.

Example workflow (Put the following text into .github/workflows/main.yml):

on: push
name: Lint Python
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: cclauss/Find-Python-syntax-errors-action@master

Flake8 finds Python 3 syntax errors and undefined names

$ flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree

About

A GitHub Action that finds Python syntax errors and undefined names in your repo

Resources

License

Packages

No packages published