Skip to content

Commit

Permalink
gha: switch to ruff/pre-commit for linting (#74)
Browse files Browse the repository at this point in the history
* gha: switch to ruff/pre-commit for linting

* ruff/black: line-length 100

* gitmodules: eof newline
  • Loading branch information
chadsr committed May 25, 2024
1 parent 0c62e06 commit cbe0cf7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
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

0 comments on commit cbe0cf7

Please sign in to comment.