diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..a6dcb8f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,19 @@ +name: Run linter & formatting check + +on: [push, pull_request] + +jobs: + check-formatting: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: astral-sh/ruff-action@v1 + with: + args: "check" + + - uses: astral-sh/ruff-action@v1 + with: + args: "format --check" + diff --git a/Makefile b/Makefile index a2dff42..49fa124 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,12 @@ clean: find . -name '*.egg' -exec rm -f {} + find . -name '*.pyc' -exec rm -f {} + find . -name '*.pyo' -exec rm -f {} + + +lint-check: + ruff check + +format-check: + ruff format --check + +format: + ruff format