Skip to content

Commit

Permalink
feat: add pre-commit and ruff rulesets
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperDramsch committed Aug 2, 2024
1 parent b493b04 commit 466ef9e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
23 changes: 18 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ repos:
- id: no-commit-to-branch # Prevent committing to main / master
- id: check-added-large-files # Check for large files added to git
- id: check-merge-conflict # Check for files that contain merge conflict
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0 # Use the ref you want to point at
hooks:
- id: python-use-type-annotations # Check for missing type annotations
- id: python-check-blanket-noqa # Check for # noqa: all
- id: python-no-log-warn # Check for log.warn
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
Expand Down Expand Up @@ -59,12 +65,19 @@ repos:
hooks:
- id: docconvert
args: ["numpy"]
- repo: https://github.com/b8raoult/optional-dependencies-all
rev: "0.0.6"
hooks:
- id: optional-dependencies-all
args: ["--inplace", "--exclude-keys=dev,docs,tests", "--group=dev=all,docs,tests"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.1.3"
hooks:
- id: pyproject-fmt
- repo: https://github.com/jshwi/docsig # Check docstrings against function sig
rev: v0.44.2
hooks:
- id: docsig
args:
- --ignore-no-params # Allow docstrings without parameters
- --check-dunders # Check dunder methods
- --check-overridden # Check overridden methods
- --check-protected # Check protected methods
- --check-class # Check class docstrings
- --disable=E113 # Disable empty docstrings
- --summary # Print a summary
18 changes: 8 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ classifiers = [
dynamic = [
"version",
]

dependencies = [
"anemoi-datasets[data]>=0.4",
"anemoi-models",
Expand All @@ -74,35 +75,32 @@ optional-dependencies.all = [
]

optional-dependencies.dev = [
"nbsphinx",
"pandoc",
"pytest",
"pytest-mock",
"sphinx",
"sphinx-argparse",
"sphinx-rtd-theme",
"anemoi-training[tests]",
]

optional-dependencies.docs = [
"nbsphinx",
"pandoc",
"sphinx",
"sphinx-argparse",
"sphinx-rtd-theme",
]

optional-dependencies.tests = [
"pytest",
"pytest-mock",
]

urls.Changelog = "https://github.com/ecmwf/anemoi-training/CHANGELOG.md"
urls.Documentation = "https://anemoi-training.readthedocs.io/"
urls.Homepage = "https://github.com/ecmwf/anemoi-training/"
urls.Issues = "https://github.com/ecmwf/anemoi-training/issues"
urls.Repository = "https://github.com/ecmwf/anemoi-training/"
# Changelog = "https://github.com/ecmwf/anemoi-training/CHANGELOG.md"
# Add subcommand in the `commands` directory
scripts.anemoi-training = "anemoi.training.__main__:main"

[tool.setuptools_scm]
version_file = "src/anemoi/training/_version.py"

[tool.ruff]
select = [
"ALL",
]

0 comments on commit 466ef9e

Please sign in to comment.