Skip to content

Commit

Permalink
reconfigure pre-commit validation (#1427)
Browse files Browse the repository at this point in the history
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/
  • Loading branch information
zaro0508 committed Jan 24, 2024
1 parent dcdf1d1 commit 34abd51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -101,7 +90,6 @@ jobs:

integration-tests:
needs:
- linting
- packaging
- documentation
- unit-tests
Expand Down
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,18 @@ $ git checkout -b <branch-name>
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
Expand Down

0 comments on commit 34abd51

Please sign in to comment.