From 1f5a4737f7543675cb20ac69a3fb8d1fcf2c99b6 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Thu, 20 Oct 2022 12:00:50 +0200 Subject: [PATCH] ci(pre-commit): Pin rust version and set minimum pre-commit version Mixxx is a C project, and requiring contributors to set up a rust installation on their systems just to be able to use `qml_formatter` is a bit tedious. Fortunately, pre-commit 2.21.0+ features support for bootstrapping Rust toolchains using rustup, so that no preexisting system install is necessary. See https://github.com/pre-commit/pre-commit/pull/2534 for details. We set pre-commit 2.21.0 as the minimum required version, to prevent users that use an older pre-commit version and don't have rust installed from running into problems and to inform them that they should update. If someone uses an pre-commit version < 2.21.0, the following error message will be shown: $ pre-commit run An error has occurred: InvalidConfigError: ==> File .pre-commit-config.yaml ==> At Config() ==> At key: minimum_pre_commit_version =====> pre-commit version 2.21.0 is required but version 2.20.0 is installed. Perhaps run `pip install --upgrade pre-commit`. Check the log at /home/user/.cache/pre-commit/pre-commit.log --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 846339078703..7e1cf62246a0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,8 +26,10 @@ # _anlz.h/_pdb.h: Header files generated by Kaitai Struct exclude: ^(lib/|src/test/.*data/).*|res/translations/.*\.ts|src/.*_(anlz|pdb)\.h$ +minimum_pre_commit_version: 2.21.0 default_language_version: python: python3 + rust: 1.64.0 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0