From 33cce2b5ac9d6528815e266ad301e740374f54b5 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 22 Feb 2022 15:42:16 +0100 Subject: [PATCH] add pre-commit configuration This enables use of the `pre-commit` framework to run quick pre-commit checks. In particular this allows to automatically fix: * trailing white spaces * absence or multiple newlines at the end of files * QL code formatting * file sync More could be added in the future: anything that can be checked fast can be added in the configuration (for example well-formedness of `qldoc` files). This is a purely opt-in feature. Instructions for enabling it and possibly configuring its behaviour are in `pre-commit-hook-setup.md`. --- .pre-commit-config.yaml | 21 +++++++++++++++++++++ CONTRIBUTING.md | 8 ++++++-- docs/pre-commit-hook-setup.md | 18 ++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..c95ccf5f280 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +exclude: /test/.*$(?