Skip to content

Commit

Permalink
Merge pull request #247 from ocefpaf/ruff
Browse files Browse the repository at this point in the history
Using ruff and some notebook QA pre-commits
  • Loading branch information
ocefpaf committed Jun 12, 2023
2 parents a6b8de5 + 760ec10 commit 39c5997
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 177 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Expand Up @@ -36,6 +36,5 @@ jobs:
- name: Tests
shell: bash -l {0}
run: |
micromamba activate TEST
pytest -s -rxs -vv -Werror tests/ --mpl --mpl-generate-summary=html \
--mpl-results-path="windrose_test_output-${{ matrix.os }}-${{ matrix.python-version }}"
61 changes: 38 additions & 23 deletions .pre-commit-config.yaml
Expand Up @@ -15,26 +15,17 @@ repos:
- id: file-contents-sorter
files: requirements-dev.txt

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: docs/source/conf.py
args: [--max-line-length=105]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
additional_dependencies: [toml]
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
Expand All @@ -46,10 +37,6 @@ repos:
args:
- --ignore-words-list=celles,hist,therefor

- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc

- repo: https://github.com/econchick/interrogate
rev: 1.5.0
Expand All @@ -58,12 +45,40 @@ repos:
exclude: ^(docs|setup.py|tests)
args: [--config=pyproject.toml]

- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.5.1
hooks:
- id: pyupgrade
args:
- --py36-plus
- id: add-trailing-comma

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
hooks:
- id: ruff

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.11.2
hooks:
- id: pyproject-fmt

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
# mdformat works on the CLI but not as pre-commit yet.
# Use `nbqa mdformat jupyterbook --nbqa-md` to run it locally.
# - id: mdformat
- id: nbqa-check-ast
- id: nbqa-black
- id: nbqa-ruff
# We are skipping:
# E402 -> Module level import not at top of file
# T201 -> `print` found
# B018 -> Found useless expression.
args: [--fix, "--extend-ignore=E402,T201,B018"]

- repo: https://github.com/bdice/nb-strip-paths
rev: v0.1.0
hooks:
- id: nb-strip-paths

ci:
autofix_commit_msg: |
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -114,7 +114,7 @@
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
"donate.html",
]
],
}


Expand Down Expand Up @@ -151,7 +151,7 @@
"windrose Documentation",
"Lionel Roubeyrie \\& Sebastien Celles",
"manual",
)
),
]


Expand All @@ -176,7 +176,7 @@
"windrose",
"One line description of project.",
"Miscellaneous",
)
),
]


Expand Down

0 comments on commit 39c5997

Please sign in to comment.