From 34abd512a7c823882eaf6039d1d75030bc815eb5 Mon Sep 17 00:00:00 2001 From: Khai Do <3697686+zaro0508@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:26:45 -0800 Subject: [PATCH] reconfigure pre-commit validation (#1427) We have setup pre-commit.ci[1] to offload the execution of pre-commit. This is supposed to be faster and easier to maintain than running it with GH actions. [1] https://pre-commit.ci/ --- .github/workflows/main.yaml | 12 ------------ CONTRIBUTING.md | 11 +++++++---- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bc5dde9b3..c9c738fea 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,17 +17,6 @@ on: - '*' jobs: - linting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Poetry - uses: snok/install-poetry@v1 - - name: Install dependencies - run: poetry install --no-interaction --all-extras - - name: run pre-commit - run: poetry run pre-commit run --all-files --show-diff-on-failure - packaging: runs-on: ubuntu-latest steps: @@ -101,7 +90,6 @@ jobs: integration-tests: needs: - - linting - packaging - documentation - unit-tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0351259d..b3cd59876 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,15 +119,18 @@ $ git checkout -b As a pre-deployment step we syntatically validate files with [pre-commit](https://pre-commit.com). -Please [install pre-commit](https://pre-commit.com/#install) then run -`pre-commit install` to setup the git hooks. Once configured the pre-commit -linters will automatically run on every git commit. Alternatively you -can manually execute the validations by running `pre-commit run --all-files`. +Run `poetry run pre-commit install` to setup the git hooks. Once configured +the pre-commit linters will automatically run on every git commit. +Alternatively you can manually execute the validations by running ```bash $ poetry run pre-commit run --all-files ``` +The CI for pre-commit has been offloaded to [pre-commit.ci](https://pre-commit.ci) +The configuration is in the [pre-commit-config.yaml](.pre-commit-config.yaml) +file. + ## Unit Tests Sceptre aims to be compatible with Python 3, please run unit test