@@ -15,24 +15,67 @@ jobs:
1515 steps :
1616 - name : Check out Git repository
1717 uses : actions/checkout@v4
18+
1819 - name : Set up Python ${{ matrix.python-version }}
1920 uses : actions/setup-python@v5
2021 with :
2122 python-version : ${{ matrix.python-version }}
23+
2224 - name : Install dependencies
2325 run : |
2426 python -m pip install --upgrade pip
25- pip install ruff pytest numpy setuptools>=66 wheel>=0.36 build
27+ # Install linting tools from pre-commit config
28+ pip install ruff black codespell toml-sort validate-pyproject-schema-store blacken-docs
29+ # Install project dependencies
30+ pip install pytest numpy setuptools>=66 wheel>=0.36 build
2631 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2732 if [ -f pyproject.toml ]; then pip install -e .; fi
2833
29- - name : Run Lint
34+ - name : Run Ruff (linting)
35+ run : |
36+ # Check for linting issues (matching pre-commit args)
37+ ruff check . --fix --exit-non-zero-on-fix
38+
39+ - name : Run Black (formatting)
40+ run : |
41+ # Check for formatting issues
42+ black --check .
43+
44+ - name : Run Codespell
45+ run : |
46+ # Check for spelling mistakes
47+ codespell
48+
49+ - name : Validate pyproject.toml
50+ run : |
51+ # Validate pyproject.toml if it exists
52+ if [ -f pyproject.toml ]; then
53+ validate-pyproject pyproject.toml
54+ fi
55+
56+ - name : Check TOML files
3057 run : |
31- # Check for linting issues
32- ruff check .
33- # Check for formatting issues (will fail if code needs formatting)
34- ruff format --check .
58+ # Check and sort TOML files
59+ find . -name "*.toml" -type f -exec toml-sort --check {} \;
60+
61+ - name : Run Blacken-docs
62+ run : |
63+ # Check Python code blocks in documentation
64+ blacken-docs --check **/*.md **/*.rst || true # Allow failure for now
65+
66+ pre-commit :
67+ runs-on : ubuntu-latest
68+ steps :
69+ - name : Check out Git repository
70+ uses : actions/checkout@v4
71+
72+ - name : Set up Python
73+ uses : actions/setup-python@v5
74+ with :
75+ python-version : " 3.12"
3576
77+ - name : Run pre-commit
78+ uses : pre-commit/action@v3.0.1
3679 test :
3780 runs-on : ubuntu-latest
3881 strategy :
0 commit comments