diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..899d937 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,3 @@ +default: true + +MD013: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3c145bc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,76 @@ +default_install_hook_types: + - pre-commit + - pre-push + +repos: + # Go checks use the repository's configured Go toolchain. + - repo: local + hooks: + - id: go-fmt + name: gofmt + entry: gofmt -w + language: system + types: [go] + + - id: go-mod-tidy + name: go mod tidy + entry: go mod tidy + language: system + pass_filenames: false + files: '(^|/)(go\.(mod|sum)|.*\.go)$' + + - id: go-build + name: go build + entry: go build ./... + language: system + pass_filenames: false + files: '(^|/)(go\.(mod|sum)|.*\.go)$' + + - id: go-unit-tests + name: go test + entry: go test ./... + language: system + pass_filenames: false + files: '(^|/)(go\.(mod|sum)|.*\.go)$' + + - id: golangci-lint + name: golangci-lint + entry: golangci-lint run + language: system + pass_filenames: false + files: '(^|/)(go\.(mod|sum)|.*\.go)$' + + - id: go-e2e-tests + name: go test (e2e) + entry: go test -tags=e2e -v . + language: system + pass_filenames: false + files: '(^|/)(go\.(mod|sum)|.*\.go)$' + stages: + - pre-push + - manual + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.49.1 + hooks: + - id: markdownlint + args: [--fix] + + - repo: https://github.com/codespell-project/codespell + rev: v2.4.3 + hooks: + - id: codespell + name: codespell + + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-toml + - id: check-added-large-files + args: [--maxkb=5000] + - id: check-merge-conflict + - id: check-case-conflict