From 5523f369c5a7814c735db99540312b11a8f5a8cf Mon Sep 17 00:00:00 2001 From: arfy slowy Date: Mon, 19 Feb 2024 20:56:40 +0700 Subject: [PATCH] Add pre-commit configuration (#1912) Signed-off-by: arfy slowy --- .pre-commit-config.yaml | 16 ++++++++++++++++ pyproject-codespell.precommit-toml | 3 +++ requirements_docs.txt | 26 +++++++++++++------------- 3 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject-codespell.precommit-toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..28d3ecad08 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + types: [python] + - id: trailing-whitespace + - id: requirements-txt-fixer + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + args: [--toml, pyproject-codespell.precommit-toml] diff --git a/pyproject-codespell.precommit-toml b/pyproject-codespell.precommit-toml new file mode 100644 index 0000000000..903580ed9a --- /dev/null +++ b/pyproject-codespell.precommit-toml @@ -0,0 +1,3 @@ +[tool.codespell] +ignore-words-list = "aci,acount,acounts,fallow,ges,hart,hist,nd,ned,ois,wqs,watermask" +skip="*.csv,*.geojson,*.json,*.yml*.js,*.html,*cff,*.pdf" diff --git a/requirements_docs.txt b/requirements_docs.txt index f8c62c2d09..6e615583c2 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -2,27 +2,27 @@ black black[jupyter] bump-my-version codespell -deadlink coverage +deadlink ipykernel livereload -nbconvert -nbformat -pyproject-flake8 -pip -sphinx -tox -twine -watchdog -wheel mkdocs -mkdocs-git-revision-date-plugin mkdocs-git-revision-date-localized-plugin +mkdocs-git-revision-date-plugin mkdocs-jupyter>=0.24.0 -mkdocs-material>=9.1.3 +mkdocs-material>=9.1.3 mkdocs-pdf-export-plugin mkdocstrings mkdocstrings-crystal mkdocstrings-python-legacy +nbconvert +nbformat +pip pygments -pymdown-extensions \ No newline at end of file +pymdown-extensions +pyproject-flake8 +sphinx +tox +twine +watchdog +wheel