Skip to content
bell

GitHub Action

Python quality and format checker

v0.7.0 Latest version

Python quality and format checker

bell

Python quality and format checker

Python linting and format checking using black ruff

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Python quality and format checker

uses: konstruktoid/[email protected]

Learn more about this action in konstruktoid/action-pylint

Choose a version

Python linting and testing using black and ruff

A GitHub action that checks Python code using black and ruff.

Github Actions configuration examples

on: [push, pull_request]
name: Python Linting

permissions:
  contents: read

jobs:
  PythonLinting:
    name: Python linting
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

      - name: Python linting
        uses: konstruktoid/[email protected]

Script

#!/bin/sh

set -euf

black --check --diff --no-color --quiet .
ruff check --select ALL --ignore ANN --ignore D --ignore INP --ignore PTH --ignore T20 .