starlette-example
starlette-example copied to clipboard
Add pre-commit config and GitHub Action to prevent code formatting issues.
Add pre-commit config and GitHub Action to prevent code formatting issues on pull requests.
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()