Skip to content

Commit

Permalink
Setup linting with github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
gbip committed Jan 20, 2025
1 parent 4106961 commit 1e3e942
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint source code

on:
push:
branches: [ $default-branch ]
pull_request:

jobs:

mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for versioningit to find the repo version
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: psf/black@stable
- name: Install dependencies
run: python -m pip download .[drf]

- name: Install dependencies
run: python -m pip install --upgrade pip
-r requirements/requirements-dev.in
-r requirements/requirements-test.in

# - name: Run mypy
# run: mypy --version && ./run_mypy.sh

- name: Run flake8
run : flake8 --version && flake8 --extend-ignore=E501,E503,E203 --max-line-len=88 .

- name: Run isort
run : isort --profile black .

- name: Build package
run: python -m build .
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ source = "versioningit"

[tool.versioningit.vcs]
method = "git"

4 changes: 3 additions & 1 deletion requirements/requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

pip-tools
pre-commit
ruff
isort
flake8
black
mypy
djangorestframework-stubs[compatible-mypy]
django-stubs[compatible-mypy]
Expand Down

0 comments on commit 1e3e942

Please sign in to comment.