diff --git a/Contributing.md b/Contributing.md index 25002412..668becad 100644 --- a/Contributing.md +++ b/Contributing.md @@ -14,7 +14,7 @@ This repo follows the [Contributor Covenant](http://contributor-covenant.org/ver This repo uses automated tools to standardize the formatting of code, text files and commits. - - [Pre-commit hooks](#pre-commit-hooks) validate and automatically apply code + - [Pre-commit/prek hooks](#pre-commitprek-hooks) validate and automatically apply code formatting rules. - [gitlint](#gitlint) is used as a commit message hook to validate that commit messages follow the convention. @@ -28,19 +28,19 @@ Run these commands in each of your sandboxes to enable our pre-commit hooks and ```sh pip install -e '.[dev]' -pre-commit install +prek install gitlint install-hook -git submodule foreach 'pre-commit install' +git submodule foreach 'prek install' git submodule foreach 'gitlint install-hook' ``` -## Pre-commit hooks +## Pre-commit/prek hooks The ReadAlong Studio team has agreed to systematically use a number of pre-commit hooks to -normalize formatting of code. You need to install and enable pre-commit to have these used -automatically when you do your own commits. +normalize formatting of code. You need to install and enable prek (fast replacement of pre-commit) +to have these used automatically when you do your own commits. -Pre-commit hooks enabled: +Pre-commit hooks we use: - check-yaml validates YAML files - end-of-file-fixer makes sure each text file ends with exactly one newline character - trailing-whitespace removes superfluous whitespace at the end of lines in text files @@ -58,7 +58,7 @@ Pre-commit hooks enabled: ### Enabling pre-commit hooks All the pre-commit hooks are executed using a tool called -[pre-commit](https://pre-commit.com/). Once you enable pre-commit, it will run all the +[prek](https://prek.j178.dev/). Once you enable prek, it will run all the hooks each time you try to commit anything in this repo. The developer dependencies are listed in the dev extra in [pyproject.toml](pyproject.toml) @@ -66,7 +66,7 @@ to make them easy to install: ```sh pip install -e '.[dev]' -pre-commit install +prek install ``` Note that you have to run the second command in every sandbox you create, so please @@ -142,13 +142,13 @@ gitlint install-hook ### Initializing submodules too -The EveryVoice repo uses submodules, and the gitlint and pre-commit +The EveryVoice repo uses submodules, and the gitlint and prek/pre-commit initialization has to be done separately in each of one them. You can cd into each submodule directory and run the same commands shown above, but there is a shortcut: ```sh -git submodule foreach 'pre-commit install' +git submodule foreach 'prek install' git submodule foreach 'gitlint install-hook' ``` diff --git a/README.md b/README.md index c43dbe99..495eeaec 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,9 @@ Please make sure our standard Git hooks are activated, by running these commands ```sh pip install -e '.[dev]' -pre-commit install +prek install gitlint install-hook -git submodule foreach 'pre-commit install' +git submodule foreach 'prek install' git submodule foreach 'gitlint install-hook' ``` diff --git a/docs/install.md b/docs/install.md index 8fcf9eca..604e18be 100644 --- a/docs/install.md +++ b/docs/install.md @@ -219,8 +219,8 @@ Before you can run the test suites, you'll also need to install the dev dependen If you plan to contribute to the project, please install our Git hooks: ```sh -pre-commit install +prek install gitlint install-hook -git submodule foreach 'pre-commit install' +git submodule foreach 'prek install' git submodule foreach 'gitlint install-hook' ``` diff --git a/everyvoice/model/feature_prediction/FastSpeech2_lightning b/everyvoice/model/feature_prediction/FastSpeech2_lightning index 0f334ee8..733d96ac 160000 --- a/everyvoice/model/feature_prediction/FastSpeech2_lightning +++ b/everyvoice/model/feature_prediction/FastSpeech2_lightning @@ -1 +1 @@ -Subproject commit 0f334ee80dbf0aa44bfa1aff1d6533751ad28f0c +Subproject commit 733d96ac7c83e3b6cbaa2d8f479c4e92aa54e4ef diff --git a/everyvoice/model/vocoder/HiFiGAN_iSTFT_lightning b/everyvoice/model/vocoder/HiFiGAN_iSTFT_lightning index c4939894..08608207 160000 --- a/everyvoice/model/vocoder/HiFiGAN_iSTFT_lightning +++ b/everyvoice/model/vocoder/HiFiGAN_iSTFT_lightning @@ -1 +1 @@ -Subproject commit c493989454dc222d14662aca587657dd8e943958 +Subproject commit 08608207269a6ae2ad4429f047a359cfa3e125af diff --git a/make-everyvoice-env b/make-everyvoice-env index 4784c10b..27c21c6a 100755 --- a/make-everyvoice-env +++ b/make-everyvoice-env @@ -246,8 +246,8 @@ echo "Environment creation completed with success" echo "" echo "Configuring your sandbox in case you want to contribute to the project." if [[ ! -f .git/hooks/pre-commit ]]; then - if ! pre-commit install; then - echo "Error running \"pre-commit install\". Your \"$ENV2ACTIVATE\" environment is good, but if you want to submit contributions to the project, please rerun \"pre-commit install\" in your sandbox." + if ! prek install; then + echo "Error running \"prek install\". Your \"$ENV2ACTIVATE\" environment is good, but if you want to submit contributions to the project, please rerun \"prek install\" in your sandbox." fi fi if [[ ! -f .git/hooks/commit-msg ]]; then @@ -257,7 +257,7 @@ if [[ ! -f .git/hooks/commit-msg ]]; then fi fi # Try to install pre-commit and gitlint hooks in the submodules but don't complain on failure -git submodule foreach 'test -f $(cat .git|cut -f2 -d" ")/hooks/pre-commit || pre-commit install || true' >& /dev/null || true +git submodule foreach 'test -f $(cat .git|cut -f2 -d" ")/hooks/pre-commit || prek install || true' >& /dev/null || true git submodule foreach 'test -f $(cat .git|cut -f2 -d" ")/hooks/commit-msg || gitlint install-hook || true' >& /dev/null || true echo "" diff --git a/pyproject.toml b/pyproject.toml index 3a2962e7..02cf5145 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,7 +100,7 @@ dev = [ "gitlint-core>=0.19.0", "isort>=5.10.1", "mypy>=1.8.0", - "pre-commit>=3.2.0", + "prek>=0.3", "types-pyyaml>=6.0.5", "types-requests>=2.27.11", "types-setuptools>=57.4.9",