Skip to content

Commit f5a4c84

Browse files
committed
build: add pre-commit hooks and markdownlint configuration
1 parent 62ecbf8 commit f5a4c84

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

.markdownlint.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Markdownlint configuration
2+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
3+
4+
# Disable some overly strict rules
5+
MD033: false # Inline HTML
6+
MD041: false # First line in file should be a top level header
7+
MD024: false # Multiple headers with the same content
8+
MD036: false # Emphasis used instead of a header
9+
10+
# Configure line length
11+
MD013:
12+
line_length: 120
13+
code_blocks: false
14+
tables: false

.pre-commit-config.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Pre-commit configuration for terraform-provider-pocketid
2+
# See https://pre-commit.com for more information
3+
repos:
4+
# General file checks
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v5.0.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-merge-conflict
11+
- id: check-yaml
12+
- id: check-json
13+
- id: check-toml
14+
- id: check-added-large-files
15+
args: ['--maxkb=500']
16+
- id: check-case-conflict
17+
- id: check-executables-have-shebangs
18+
- id: mixed-line-ending
19+
20+
# Go specific hooks
21+
- repo: https://github.com/TekWizely/pre-commit-golang
22+
rev: v1.0.0-rc.1
23+
hooks:
24+
- id: go-fmt
25+
- id: go-vet-mod
26+
- id: go-mod-tidy
27+
- id: go-test-mod
28+
args: ['-timeout=5m']
29+
- id: go-build-mod
30+
- id: golangci-lint-mod
31+
args: ['--timeout=5m']
32+
33+
# Security scanning
34+
- repo: https://github.com/trufflesecurity/trufflehog
35+
rev: v3.89.2
36+
hooks:
37+
- id: trufflehog
38+
name: TruffleHog
39+
description: Detect secrets in your data.
40+
entry: bash -c 'trufflehog git file://. --since-commit HEAD --only-verified --fail'
41+
language: system
42+
stages: ["commit", "push"]
43+
44+
# Terraform/HCL formatting
45+
- repo: https://github.com/antonbabenko/pre-commit-terraform
46+
rev: v1.99.4
47+
hooks:
48+
- id: terraform_fmt
49+
args:
50+
- --args=-recursive
51+
52+
# Markdown linting
53+
- repo: https://github.com/igorshubovych/markdownlint-cli
54+
rev: v0.45.0
55+
hooks:
56+
- id: markdownlint
57+
args: ['--fix']
58+
59+
# Commit message validation
60+
- repo: https://github.com/compilerla/conventional-pre-commit
61+
rev: v4.2.0
62+
hooks:
63+
- id: conventional-pre-commit
64+
stages: [commit-msg]
65+
args: [feat, fix, docs, style, refactor, test, chore, ci, build]
66+
67+
# Global configuration
68+
fail_fast: false
69+
minimum_pre_commit_version: "3.0.0"

0 commit comments

Comments
 (0)