Skip to content

Commit

Permalink
feat: add pre-commit and various hook files
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoSagadin committed Mar 19, 2024
1 parent 7bc1bcb commit 1dcdab1
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .markdownlint.yaml
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
92 changes: 92 additions & 0 deletions .pre-commit-config.yaml
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]
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"overrides": [
{
"files": "**/*.md",
"options": {
"proseWrap": "always",
"printWidth": 80
}
}
]
}
4 changes: 4 additions & 0 deletions committed.toml
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"]
12 changes: 12 additions & 0 deletions ruff.toml
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"
7 changes: 7 additions & 0 deletions typos.toml
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"

0 comments on commit 1dcdab1

Please sign in to comment.