Skip to content

Commit

Permalink
Add pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 2, 2024
1 parent 61a9fff commit 238598b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ jobs:
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: cd c2cciutils; npm install
- run: python3 -m pip install --user --requirement=requirements.txt

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Apply pre-commit fix.patch
path: /tmp/pre-commit.patch
retention-days: 1
if: failure()

- run: poetry build
env:
POETRY_DYNAMIC_VERSIONING_BYPASS: 0.0.0
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ repos:
rev: 1.0.0
hooks:
- id: copyright
exclude: |-
(?x)^(
example-project/.*
)
- id: poetry-lock
additional_dependencies:
- poetry==1.3.2 # pypi
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
All the code in this library is provided under this license:

Copyright (c) 2020, Camptocamp SA
Copyright (c) 2020-2024, Camptocamp SA
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ poetry==1.3.2
poetry-plugin-export==1.2.0
poetry-dynamic-versioning[plugin]==0.19.0
poetry-plugin-tweak-dependencies-version==1.2.1
pre-commit==3.8.0
pip==23.3.2
importlib-metadata>=7.0.0,<8.0.0
certifi>=2024.7.4 # not directly required, pinned by Snyk to avoid a vulnerability
Expand Down

0 comments on commit 238598b

Please sign in to comment.