From ac2358ff0d3956f18d34c9cea2aa1db9e84d8cba Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 9 Dec 2020 18:01:06 +0000 Subject: [PATCH] Meta: Add .pre-commit-config.yaml This pre-commit config is quite simple: all it does for now is running the already existing Meta/lint-ci.sh script to ensure no changes that won't pass the CI linting step are committed. Consequently pass_filenames is set to false, as these scripts will determine which files to check themselves - should this ever become a performance bottleneck, we can update them to accept an optional list of filenames. It should be noted that using pre-commit for Serenity development is by no means a requirement, but doing so may decrease the number of CI builds failing due to forgotten license headers etc. - especially if you're pushing to `master` directly, rather than going through pull requests *hint hint*. For info how to install & use pre-commit, see https://pre-commit.com/. Fixes #2365. --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..1763a5e4cb --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: local + hooks: + - id: meta-lint-ci + name: Running Meta/lint-ci.sh to ensure changes will pass linting on CI + entry: bash Meta/lint-ci.sh + language: system + pass_filenames: false