starlette-example icon indicating copy to clipboard operation
starlette-example copied to clipboard

Add pre-commit config and GitHub Action to prevent code formatting issues.

Open rafrafek opened this issue 3 years ago • 0 comments

Add pre-commit config and GitHub Action to prevent code formatting issues on pull requests.

image

E. g. .pre-commit-config.yaml

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer

.github/workflows/main.yml

name: CI
on:
  push
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: "3.7"
      - uses: pre-commit/[email protected]
        if: always()

rafrafek avatar Nov 07 '22 16:11 rafrafek