diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc9d6e0..19b6c1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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/action@v3.0.1 + env: + RUFF_OUTPUT_FORMAT: github test: needs: lint strategy: diff --git a/.gitmodules b/.gitmodules index e4d681d..8c9be31 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule ".submodules/cryptofont"] path = .submodules/cryptofont url = https://github.com/Cryptofonts/cryptofont.git - branch = master \ No newline at end of file + branch = master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d3845f4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index c4f9aff..43d7d2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]