A GitHub action that checks Python code using black, safety and flake8 with some addtitional plugins.
black - code formatter
flake8 - glues together Python tools and plugins
flake8-bandit - security testing
flake8-bugbear - bug finder
flake8-deprecated - warns about deprecated method calls
flake8-executable - checks executable permissions and shebangs
safety - checks dependencies for known security vulnerabilities
on: [push, pull_request]
name: Python Linting
jobs:
PythonLinting:
name: Python linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Konstruktoid Python linting
uses: konstruktoid/action-pylint@master
workflow "Python Linting" {
on = "push"
resolves = ["python-linting"]
}
action "python-linting" {
uses = "konstruktoid/action-pylint@master"
}
#!/bin/sh
set -euf
if [ -f ./requirements.txt ]; then
safety check --bare --file ./requirements.txt
fi
black --quiet --check .
flake8 .