Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python Tests

on:
push:
branches-ignore: [ "main" ]
pull_request:
branches: [ "**" ]

Expand All @@ -15,7 +10,20 @@ permissions:
pull-requests: write

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.13'
- uses: launchbynttdata/actions-asdf-install_tools@v0.2.0
with:
exclude_tools: "python"
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd

run-tests:
needs: [ pre-commit ]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -29,9 +37,6 @@ jobs:
uses: astral-sh/setup-uv@445689ea25e0de0a23313031f5fe577c74ae45a1
with:
python-version: ${{ matrix.python-version }}
- name: Ruff check
run: |
uvx ruff check
- name: Install dependencies
run: |
uv sync
Expand Down
43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
repos:
- repo: https://github.com/astral-sh/uv-pre-commit
rev: ac44eab0cf35cf4268a18f1e7c20e0980550d6fa # 0.7.15
hooks:
- id: uv-lock
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # v5.0.0
hooks:
- id: trailing-whitespace
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-yaml
args:
- --allow-multiple-documents
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=auto
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 8a948e557ca98afa9489998ad0b85515964df9c4 # v0.12.0
hooks:
- id: ruff-check
types_or: [python, pyi]
args: [--fix]
- id: ruff-format
types_or: [python, pyi]
- repo: https://github.com/RobertCraigie/pyright-python
rev: 708a9d4a964376a7be931b7721d315ef1d2db31d # v1.1.402
hooks:
- id: pyright
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: 2f8bda194a420ad77a050a9de627d77a74841fdc # v1.99.4
hooks:
- id: terragrunt_fmt
- id: terragrunt_validate_inputs
exclude: "^[^/]+$"
args:
- --env-vars=TF_VAR_organization_tag="THIS_ORGANIZATION"
- --env-vars=TF_VAR_repository_tag="THIS_REPOSITORY"
- --env-vars=TF_VAR_commit_hash_tag="THIS_COMMIT_HASH"
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pre-commit 3.3.3
python 3.13.1
terraform 1.5.5
terragrunt 0.54.11
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ exclude = [
"site-packages",
".venv",
]

[tool.pyright]
# ...
venvPath = "."
venv = ".venv"
Loading