Skip to content

Commit

Permalink
Drop black in favor of Ruff (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggravlingen authored Jul 6, 2024
1 parent 1aa6a37 commit 695b539
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,20 @@ jobs:
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Run ruff (fully)
- name: Run ruff
run: |
source .venv/bin/activate
pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure
- name: Run Black
env:
RUFF_OUTPUT_FORMAT: github
- name: Run ruff-format
run: |
source .venv/bin/activate
black --check --fast --quiet --diff pygleif tests
pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
# - name: Run mypy
# run: mypy pyesef
- name: Run pylint
run: |
source .venv/bin/activate
pylint pygleif tests

pytest:
name: Run test suite
Expand Down
43 changes: 12 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,30 @@
---
repos:
- hooks:
- args:
- "--fix"
id: ruff
- id: ruff
args:
- --fix
- id: ruff-format
files: ^((pygleif|tests|examples)/.+)?[^/]+\.(py|pyi)$
repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.5.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: requirements-txt-fixer
- id: check-ast
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
exclude: (.vscode|.devcontainer)
- id: no-commit-to-branch
args:
- --branch=main
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
name: black
args:
- --safe
- --quiet
files: ^(pygleif|examples|tests)/.+\.py$
- repo: local
hooks:
- id: pylint
name: pylint
stages: [manual]
# DO NOT ACTIVATE until all files have been manually updated.
entry: pylint
language: system
types: [python]
files: ^(pygleif|examples|tests)/.+\.py$
- repo: local
hooks:
- id: pytest
name: pytest
args:
- --timeout=30
- --cov=pygleif
- --cov-report=html
stages: [push, manual]
entry: pytest
language: system
types: [python]
files: tests
entry: script/run-in-env.sh pylint -j 0 --ignore-missing-annotations=y
language: script
types_or: [python, pyi]
files: ^(pygleif|tests)/.+\.(py|pyi)$
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ classifiers = [

[project.optional-dependencies]
test = [
"black==24.3.0",
"coverage==7.4.4",
"mypy==1.9.0",
"pre-commit==3.7.0",
Expand Down

0 comments on commit 695b539

Please sign in to comment.