From a31a2a6d907da5b89b5065005c14ce6275dc05e8 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 23 Jan 2024 17:13:50 -0500 Subject: [PATCH] chore: add precommit config files --- .pre-commit-config.yaml | 48 +++++++++++++++++++++++++++++++++++++++++ .prettierignore | 8 +++++++ .prettierrc | 7 ++++++ 3 files changed, 63 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..12dc373 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,48 @@ +default_install_hook_types: [pre-commit, commit-msg] +default_stages: [pre-commit] +exclude: | + (?x)( + ^assets/| + ^docs/.*.html| + ^_extensions/ + ) +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v1.2.3 + hooks: + - id: check-added-large-files + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-json + # spell check + - repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell + # https://github.com/codespell-project/codespell/issues/1498 + # Python formatting + - repo: https://github.com/psf/black + rev: 23.7.0 + hooks: + - id: black + # R formatting + - repo: https://github.com/lorenzwalthert/precommit + rev: v0.1.2 + hooks: + - id: style-files + # general linting + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 + hooks: + - id: prettier + # enforce commit format + - repo: https://github.com/compilerla/conventional-pre-commit + rev: v2.3.0 + hooks: + - id: conventional-pre-commit + stages: [commit-msg] + args: [] + - repo: https://github.com/citation-file-format/cffconvert + rev: 054bda51dbe278b3e86f27c890e3f3ac877d616c + hooks: + - id: validate-cff diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f0a6037 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +# gitignore +.nextflow* +work/ +data/ +results/ +.DS_Store +*.code-workspace +assets/*.html diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..81ee40a --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +overrides: + - files: + - "*.md" + - "*.cff" + - ".prettierrc" + options: + tabWidth: 2