X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=.pre-commit-config.yaml;h=984ea24d3ba2ec8a630297e0b0c8eec7b520797c;hb=a254df8d0b68df0daf98ba407643d84cd75f5b98;hp=6a43c26257ac036ab12f547cfd64d23bd5d8f90f;hpb=4831dd89737954c091105cd67d2ac113c8ac1780;p=releng%2Fglobal-jjb.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a43c262..984ea24d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,77 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v3.1.0 hooks: - id: trailing-whitespace - repo: https://github.com/prettier/prettier - rev: 1.19.1 + rev: 2.0.5 hooks: - id: prettier - repo: https://github.com/jorisroovers/gitlint - rev: v0.12.0 + rev: v0.13.1 hooks: - id: gitlint - repo: https://github.com/jumanjihouse/pre-commit-hooks - rev: 1.11.2 + rev: 2.1.1 hooks: - id: shellcheck + + - repo: local + hooks: + # TODO: Switch to upstream hook when https://github.com/btford/write-good/pull/119 is merged. + - id: write-good + name: write-good + description: Check docs for English prose with write-good + entry: write-good + language: node + files: "\\.(rst|md|markdown|mdown|mkdn)$" + additional_dependencies: ["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 + )$ + + # TODO: Switch to upstream hook when https://github.com/btford/write-good/pull/119 is merged. + # Files listed below break the following write-good rules: + # - adverb weakens meaning + # - is wordy or unneeded + # + # This allows us to place an exception need 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 + description: Check docs for English prose with write-good + entry: write-good --no-adverb --no-tooWordy + language: node + files: docs/jjb/lf-ci-jobs.rst + additional_dependencies: ["write-good"] + + # TODO: Switch to upstream hook when https://github.com/btford/write-good/pull/119 is merged. + # Files listed below break the following write-good rules: + # - is wordy or unneeded + # + # This allows us to place an exception need 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 + description: Check docs for English prose with write-good + entry: write-good --no-tooWordy + language: node + files: > + (?x)^( + docs/jjb/lf-c-cpp-jobs.rst| + docs/jjb/lf-macros.rst| + docs/jjb/lf-python-jobs.rst + )$ + additional_dependencies: ["write-good"]