diff --git a/.github/workflows/pr_pre-commit.yml b/.github/workflows/pr_pre-commit.yml new file mode 100644 index 0000000..b136936 --- /dev/null +++ b/.github/workflows/pr_pre-commit.yml @@ -0,0 +1,23 @@ +--- +name: pre-commit + +on: + pull_request: + +env: + CARGO_TERM_COLOR: always + HADOLINT_VERSION: "v1.17.6" + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 + with: + python-version: '3.12' + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 + with: + extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}" diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..dbfa455 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,20 @@ +--- +# All defaults or options can be checked here: +# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml + +# Default state for all rules +default: true + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 9999 + # Number of characters for headings + heading_line_length: 9999 + # Number of characters for code blocks + code_block_line_length: 9999 + +# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content +MD024: + # Only check sibling headings + siblings_only: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..15287ec --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +--- +default_language_version: + node: system + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # 4.6.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: detect-aws-credentials + args: ["--allow-missing-credentials"] + - id: detect-private-key + + - repo: https://github.com/adrienverge/yamllint + rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # 1.35.1 + hooks: + - id: yamllint + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: f295829140d25717bc79368d3f966fc1f67a824f # 0.41.0 + hooks: + - id: markdownlint + + - repo: https://github.com/koalaman/shellcheck-precommit + rev: 2491238703a5d3415bb2b7ff11388bf775372f29 # 0.10.0 + hooks: + - id: shellcheck + args: ["--severity=info"] + + - repo: https://github.com/rhysd/actionlint + rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1 + hooks: + - id: actionlint diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..a944498 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,9 @@ +--- +extends: default + +rules: + line-length: disable + truthy: + check-keys: false + comments: + min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443