From f18d8888ba476600a09b58eb44a8f2987db65c9e Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sat, 16 Mar 2024 19:17:11 +1000 Subject: [PATCH] Clean up the `pre-commit` config Removal of unneeded files / file types Clean up the repo root folder by moving `codespell.txt` --- codespell.txt => .github/linters/codespell.txt | 0 .pre-commit-config.yaml | 15 ++++++++------- CONTRIBUTING.md | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) rename codespell.txt => .github/linters/codespell.txt (100%) diff --git a/codespell.txt b/.github/linters/codespell.txt similarity index 100% rename from codespell.txt rename to .github/linters/codespell.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eff947a88..1df7632fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: end-of-file-fixer - id: file-contents-sorter args: [--unique] - files: ^codespell\.txt$ + files: ^\.github/linters/codespell\.txt$ - id: fix-byte-order-marker - id: forbid-submodules - id: mixed-line-ending @@ -35,17 +35,18 @@ repos: rev: v1.5.5 hooks: - id: forbid-tabs - exclude: Makefile$|Makefile\..+$|makefile$|\.mk$ + exclude: Makefile$ - id: remove-tabs args: [--whitespaces-count, "2"] - exclude: Makefile$|Makefile\..+$|makefile$|\.mk$ + exclude: Makefile$ - repo: https://github.com/codespell-project/codespell rev: v2.2.6 hooks: - id: codespell name: Run codespell description: Check spelling with codespell - entry: codespell --ignore-words=codespell.txt + entry: codespell + args: [--ignore-words=.github/linters/codespell.txt] - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 3.0.0 hooks: @@ -65,7 +66,7 @@ repos: description: Checks the style of Markdown files args: [--config=.github/linters/.markdown-lint.yml] types: [markdown] - files: \.(md|mdown|markdown)$ + files: \.md$ - repo: https://github.com/tcort/markdown-link-check rev: v3.11.2 hooks: @@ -74,7 +75,7 @@ repos: description: Checks hyperlinks in Markdown files args: [--config=.github/linters/mlc_config.json, -q] types: [markdown] - files: \.(md|mdown|markdown)$ + files: \.md$ - repo: https://github.com/adrienverge/yamllint rev: v1.35.1 hooks: @@ -83,4 +84,4 @@ repos: description: Check YAML files with yamllint args: [--strict, -c=.github/linters/.yaml-lint.yml] types: [yaml] - files: \.(yaml|yml)$ + files: \.ya?ml$ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a797b1370..7d552652c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -120,7 +120,7 @@ can use the `-f` flag: ## Spell Checking We are using `pre-commit` to run [codespell](https://github.com/codespell-project/codespell) -to check code for common misspellings. We have a small custom dictionary file [codespell.txt](codespell.txt). +to check code for common misspellings. We have a small custom dictionary file [codespell.txt](.github/linters/codespell.txt). ## Coding conventions