generated from IRNAS/irnas-projects-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pre-commit and various hook files
- Loading branch information
1 parent
7bc1bcb
commit 1dcdab1
Showing
6 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Disable line checking on the code blocks and tables. | ||
MD013: | ||
"code_blocks": false | ||
"tables": false | ||
# Disable checking for the multiple headings with the same content. | ||
MD024: false | ||
# Allow inline HTML, useful for positioning images. | ||
MD033: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
stages: [pre-commit] | ||
args: [--markdown-linebreak-ext=md] | ||
- id: end-of-file-fixer | ||
stages: [pre-commit] | ||
- id: check-yaml | ||
stages: [pre-commit] | ||
- id: check-merge-conflict | ||
stages: [pre-commit] | ||
- id: check-executables-have-shebangs | ||
stages: [pre-commit] | ||
- id: check-shebang-scripts-are-executable | ||
stages: [pre-commit] | ||
- id: mixed-line-ending | ||
stages: [pre-commit] | ||
- id: detect-private-key | ||
stages: [pre-commit] | ||
# clang-format uses .clang-format to apply formatting | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v16.0.6 | ||
hooks: | ||
- id: clang-format | ||
stages: [pre-commit] | ||
- repo: https://github.com/cheshirekow/cmake-format-precommit | ||
rev: v0.6.13 | ||
hooks: | ||
- id: cmake-format | ||
- id: cmake-lint | ||
stages: [pre-commit] | ||
# typos uses typos.toml to find and fix typos | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.17.2 | ||
hooks: | ||
- id: typos | ||
stages: [pre-commit] | ||
# committed uses committed.toml to validate commit messages | ||
- repo: https://github.com/crate-ci/committed | ||
rev: v1.0.20 | ||
hooks: | ||
- id: committed | ||
stages: [commit-msg] | ||
- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks | ||
rev: v0.1.0 | ||
hooks: | ||
- id: dockerfilelint | ||
stages: [pre-commit] | ||
- repo: https://github.com/sirosen/check-jsonschema | ||
rev: 0.28.0 | ||
hooks: | ||
- id: check-github-workflows | ||
stages: [pre-commit] | ||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: v0.9.0.6 | ||
hooks: | ||
- id: shellcheck | ||
stages: [pre-commit] | ||
- repo: https://github.com/lovesegfault/beautysh | ||
rev: v6.2.1 | ||
hooks: | ||
- id: beautysh | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.1 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
stages: [pre-commit] | ||
- id: ruff-format | ||
stages: [pre-commit] | ||
# prettier uses .prettierrc to format files | ||
- repo: http://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
exclude: CHANGELOG.md | ||
types_or: [markdown] | ||
stages: [pre-commit] | ||
# markdownlint-cli uses .markdownlint.yaml to lint markdown files | ||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.34.0 | ||
hooks: | ||
- id: markdownlint | ||
exclude: CHANGELOG.md | ||
args: [--fix] | ||
stages: [pre-commit] | ||
|
||
default_install_hook_types: [pre-commit, commit-msg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "**/*.md", | ||
"options": { | ||
"proseWrap": "always", | ||
"printWidth": 80 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
subject_length = 72 | ||
style = "conventional" | ||
subject_capitalized=false | ||
allowed_types = ["feat", "fix", "docs", "refactor", "style", "test", "infra", "chore"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Ruff configuration file, see https://docs.astral.sh/ruff/ | ||
[lint] | ||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. | ||
# Enable pydocstyle (`D`) | ||
# Enable isort (`I`) | ||
select = ["E4", "E7", "E9", "D", "F", "I"] | ||
|
||
# Disable "Missing docstring in public module" (`D100`) | ||
ignore = ["D100"] | ||
|
||
[lint.pydocstyle] | ||
convention = "google" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[default] | ||
locale = "en-us" | ||
check-filename = true | ||
check-file = true | ||
|
||
[default.extend-words] | ||
rsource = "rsource" |