Skip to content

A GitHub action that checks Python code using black, safety and flake8.

License

Notifications You must be signed in to change notification settings

cgreene/action-pylint

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python linting and testing using black and flake8

A GitHub action that checks Python code using black, safety and flake8 with some addtitional plugins.

Tools and plugins installed

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

Github Actions configuration examples

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"
}

Script

#!/bin/sh

set -euf

if [ -f ./requirements.txt ]; then
  safety check --bare --file ./requirements.txt
fi

black --quiet --check .
flake8 .

About

A GitHub action that checks Python code using black, safety and flake8.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 85.3%
  • Shell 14.7%