Skip to content

Commit f453ca1

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

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/pre-commit.yaml

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

.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)