-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
8,925 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: pre-commit | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
inputs: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libcurl4-openssl-dev libssl-dev | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache pre-commit environments | ||
uses: actions/cache@v3 | ||
with: | ||
key: pre-commit-config-${{ hashFiles('.pre-commit-config.yaml') }} | ||
path: ~/.cache/pre-commit | ||
|
||
- name: Setup Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
architecture: x64 | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install poetry | ||
poetry --version | ||
- name: Configure Poetry | ||
run: | | ||
poetry env use 3.11 | ||
poetry debug info | ||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: pre-commit | ||
run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
ci: | ||
autofix_prs: true | ||
autoupdate_schedule: weekly | ||
autoupdate_commit_msg: "chore: pre-commit autoupdate" | ||
|
||
repos: | ||
- repo: local | ||
hooks: | ||
- id: check-poetry-lock | ||
# `pre-commit autoupdate` will update to older Poetry versions, so we | ||
# use a local hook to avoid that bug: | ||
# https://github.com/meltano/meltano/pull/7238#issuecomment-1409434351 | ||
name: check that `poetry.lock` conforms to `pyproject.toml` | ||
entry: poetry lock --check | ||
language: python | ||
pass_filenames: false | ||
additional_dependencies: | ||
- "poetry==1.6.1" | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.4.0" | ||
hooks: | ||
- id: check-json | ||
exclude: \.vscode/launch.json$ | ||
- id: check-toml | ||
- id: check-yaml | ||
exclude: ^(.+/)?template\.ya?ml$ | ||
- id: check-merge-conflict | ||
- id: end-of-file-fixer | ||
exclude: (.*\.svg) | ||
- id: trailing-whitespace | ||
exclude: ^(.bumpversion.cfg)$ | ||
|
||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: "v1.5.4" | ||
hooks: | ||
- id: remove-crlf | ||
- id: remove-tabs | ||
args: ["--whitespaces-count", "4"] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.0.289" | ||
hooks: | ||
- id: ruff | ||
args: ["--fix", "--exit-non-zero-on-fix", "--show-fixes"] | ||
- id: ruff | ||
name: Ruff format | ||
entry: ruff format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v1.5.1" | ||
hooks: | ||
- id: mypy | ||
exclude: | | ||
(?x)^( | ||
.*tests.*| | ||
)$ | ||
additional_dependencies: | ||
- "types-PyYAML==6.0.12.2" |
Oops, something went wrong.