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

gha: switch to ruff/pre-commit for linting #74

Merged
merged 3 commits into from
May 25, 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
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Lint
uses: psf/black@stable
with:
options: "--check --verbose"
use_pyproject: true
- uses: pre-commit/[email protected]
env:
RUFF_OUTPUT_FORMAT: github
test:
needs: lint
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule ".submodules/cryptofont"]
path = .submodules/cryptofont
url = https://github.com/Cryptofonts/cryptofont.git
branch = master
branch = master
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-docstring-first
- id: check-yaml
- id: end-of-file-fixer
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ pytest = "^8.2.1"
pytest-cov = "^5.0.0"
bandit = "^1.7.8"

[tool.black]
[tool.ruff]
# Use the more relaxed max line length permitted in PEP8.
line-length = 99
line-length = 100

[tool.black]
line-length = 100

[tool.bandit]
exclude = ["test_*.py", "./venv/", "./env/", "./.env,tests"]
Expand Down
Loading