Skip to content

Commit

Permalink
ci(pre-commit): Pin rust version and set minimum pre-commit version
Browse files Browse the repository at this point in the history
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 pre-commit/pre-commit#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
  • Loading branch information
Holzhaus committed Oct 20, 2022
1 parent 30520b2 commit 1f5a473
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -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
Expand Down

0 comments on commit 1f5a473

Please sign in to comment.