Skip to content

Commit da3f877

Browse files
authored
chore: Precommit hooks and workflow (#27)
* Configure pre commits and workflow * Lint fix
1 parent ceb4be6 commit da3f877

File tree

23 files changed

+64
-22
lines changed

23 files changed

+64
-22
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# and another the rest of the directory.
44

55
# All your base
6-
* @DataDog/container-platform
6+
* @DataDog/container-platform

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212

1313
**Additional environment details (Operating System, Agent telemetry, etc):**
14-
<!-- Other relevant details such as agent version, agent status, relevant agent logs, etc. --->
14+
<!-- Other relevant details such as agent version, agent status, relevant agent logs, etc. --->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Validate your changes before merge, ensuring that:
2020
* Anything else we should know when reviewing?
2121
* Possible drawbacks and tradeoffs.
2222
* Include info about alternatives that were considered and why the proposed version was chosen.
23-
-->
23+
-->

.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@a26af69be951a213d495a4c3e4e4022e16d87065 # 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:

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ crash.log
1010
crash.*.log
1111

1212
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
13-
# password, private keys, and other secrets. These should not be part of version
14-
# control as they are data points which are potentially sensitive and subject
13+
# password, private keys, and other secrets. These should not be part of version
14+
# control as they are data points which are potentially sensitive and subject
1515
# to change depending on the environment.
1616
*.tfvars
1717
*.tfvars.json
@@ -44,4 +44,4 @@ build
4444
target
4545
bin
4646
obj
47-
.DS_Store
47+
.DS_Store

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
exclude: ^(LICENSE-3rdparty\.csv|NOTICE)
7+
stages: [manual, commit]
8+
- id: trailing-whitespace
9+
exclude: ^(LICENSE-3rdparty\.csv|NOTICE)
10+
stages: [manual, commit]
11+
12+
- repo: local
13+
hooks:
14+
- id: make-fmt
15+
name: Run make fmt to format terraform code
16+
entry: make fmt
17+
language: system
18+
types: [text]
19+
stages: [commit]

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"editor.tabSize": 2,
33
"editor.insertSpaces": true
4-
}
4+
}

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

examples/ecs_fargate/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
output "example_module" {
77
value = module.datadog_ecs_fargate_task.arn
8-
}
8+
}

0 commit comments

Comments
 (0)