diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..29d17db --- /dev/null +++ b/.markdownlint.yaml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0636152 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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] diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..61227b4 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "overrides": [ + { + "files": "**/*.md", + "options": { + "proseWrap": "always", + "printWidth": 80 + } + } + ] +} diff --git a/committed.toml b/committed.toml new file mode 100644 index 0000000..3a1be0f --- /dev/null +++ b/committed.toml @@ -0,0 +1,4 @@ +subject_length = 72 +style = "conventional" +subject_capitalized=false +allowed_types = ["feat", "fix", "docs", "refactor", "style", "test", "infra", "chore"] diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..0923cf1 --- /dev/null +++ b/ruff.toml @@ -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" diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..1dac4f4 --- /dev/null +++ b/typos.toml @@ -0,0 +1,7 @@ +[default] +locale = "en-us" +check-filename = true +check-file = true + +[default.extend-words] +rsource = "rsource"