Skip to content

Commit 0edbe4c

Browse files
committed
Configure pre commits and workflow
1 parent 5f395ce commit 0edbe4c

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check formatting
2+
3+
permissions:
4+
contents: read
5+
6+
on: [pull_request, workflow_dispatch]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Install pre-commit
20+
run: pip install pre-commit
21+
22+
- name: Run pre-commit hooks
23+
run: pre-commit run --all-files --hook-stage manual

.github/workflows/terraform-docs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88
paths:
99
- "modules/ecs_fargate/**"
10-
- ".github/workflows/terraform-docs-check.yaml"
1110
workflow_dispatch:
1211

1312
jobs:

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
stages: [manual, commit]
7+
- id: trailing-whitespace
8+
stages: [manual, commit]
9+
10+
- repo: local
11+
hooks:
12+
- id: make-fmt
13+
name: Run make fmt to format terraform code
14+
entry: make fmt
15+
language: system
16+
types: [text]
17+
stages: [commit]

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ license:
44
dd-license-attribution https://github.com/datadog/terraform-aws-ecs-datadog/ --no-gh-auth > LICENSE-3rdparty.csv
55
test:
66
go test ./tests
7+
pre-commit:
8+
pre-commit run --all-files

0 commit comments

Comments
 (0)