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

Using ruff and some notebook QA pre-commits #247

Merged
merged 4 commits into from
Jun 12, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading