X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=.pre-commit-config.yaml;h=b10d63f2accf58a023fcea4f7b0a14e2548f3c42;hb=HEAD;hp=ce053483bd7439770b77240b6b6258025797c5c5;hpb=f325f0dc4d34cb79e9c15813140db1e18ed2a185;p=releng%2Fglobal-jjb.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce053483..b10d63f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,79 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.3.0 + rev: v4.5.0 hooks: - id: trailing-whitespace + - id: no-commit-to-branch + args: + - --branch=master + - --branch=main + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + stages: [commit] + + - repo: https://github.com/jorisroovers/gitlint + rev: v0.19.1 + hooks: + - id: gitlint + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.35.1 + hooks: + - id: yamllint + + - repo: https://github.com/jumanjihouse/pre-commit-hooks + rev: 3.0.0 + hooks: + - id: shellcheck + + - repo: https://github.com/btford/write-good + rev: v1.0.8 + hooks: + - id: write-good + exclude: > + (?x)^( + docs/jjb/lf-c-cpp-jobs.rst| + docs/jjb/lf-ci-jobs.rst| + docs/jjb/lf-macros.rst| + docs/jjb/lf-python-jobs.rst + )$ + + - repo: https://github.com/btford/write-good + rev: v1.0.8 + hooks: + # Files listed below break the following write-good rules: + # - adverb weakens meaning + # - is wordy or unneeded + # + # This allows us to place an exception needed to pass the check without + # disabling all checks for the whole file. In an ideal world write-good + # would give us an override for each individual instance of a violation + # but until then this gives us a close enough approach. + - id: write-good + name: "write-good --no-adverb --no-tooWordy" + args: ["--no-adverb", "--no-tooWordy"] + files: docs/jjb/lf-ci-jobs.rst + + - repo: https://github.com/btford/write-good + rev: v1.0.8 + hooks: + # Files listed below break the following write-good rules: + # - is wordy or unneeded + # + # This allows us to place an exception needed to pass the check without + # disabling all checks for the whole file. In an ideal world write-good + # would give us an override for each individual instance of a violation + # but until then this gives us a close enough approach. + - id: write-good + name: "write-good --no-tooWordy" + args: ["--no-tooWordy"] + files: > + (?x)^( + docs/jjb/lf-c-cpp-jobs.rst| + docs/jjb/lf-macros.rst| + docs/jjb/lf-python-jobs.rst + )$