Skip to content

Commit

Permalink
Merge pull request #1 from draincoder/develop
Browse files Browse the repository at this point in the history
Update lint flow
  • Loading branch information
draincoder authored Apr 10, 2024
2 parents 2202c36 + f7b4d82 commit 426a4b4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
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

1 comment on commit 426a4b4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL10100% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
1 0 💤 0 ❌ 0 🔥 0.092s ⏱️

Please sign in to comment.