Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lint flow #1

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Pre-Commit
run: python -m pip install pre-commit
python-version: 3.12

- name: Load cached Pre-Commit Dependencies
id: cached-pre-commit-dependencies
Expand All @@ -32,8 +29,23 @@ jobs:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.12
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock

- name: Install dependencies
run: pdm install -G:all

- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Execute Pre-Commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
run: pdm run pre-commit run --show-diff-on-failure --color=always --all-files

test:
runs-on: ubuntu-latest
Expand All @@ -44,12 +56,12 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: 3.12

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.12"
python-version: 3.12
allow-python-prereleases: false
cache: true
cache-dependency-path: |
Expand Down
19 changes: 15 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
default_language_version:
python: "3.12"
python: python3.12

repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/python-formate/flake8-dunder-all
rev: v0.4.0
hooks:
- id: ensure-dunder-all
exclude: "tests*"
args: ["--use-tuple"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0

- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy src tests --config-file ./pyproject.toml
language: python
language_version: python3.12
types: [ python ]
require_serial: true
pass_filenames: false
Loading