diff --git a/.copier-answers.yml b/.copier-answers.yml index 94f3324..ee170bc 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ --- # Changes here will be overwritten by Copier -_commit: v2.10.1 +_commit: v2.19.0 _src_path: gh:remerge/template project_id: terraform-modules project_license: apache-2.0 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index cb02b8b..0060841 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -38,7 +38,6 @@ jobs: uses: hashicorp/setup-terraform@v3 with: cli_config_credentials_token: "${{ secrets.TF_CLOUD_API_TOKEN }}" - terraform_version: "~> 1.5.0" - name: Setup Terraform plugin cache run: | diff --git a/.gitignore b/.gitignore index b783ef0..76ad0c3 100644 --- a/.gitignore +++ b/.gitignore @@ -52,72 +52,6 @@ secring.* -## https://raw.githubusercontent.com/github/gitignore/main/Global/Images.gitignore - -# JPEG -*.jpg -*.jpeg -*.jpe -*.jif -*.jfif -*.jfi - -# JPEG 2000 -*.jp2 -*.j2k -*.jpf -*.jpx -*.jpm -*.mj2 - -# JPEG XR -*.jxr -*.hdp -*.wdp - -# Graphics Interchange Format -*.gif - -# RAW -*.raw - -# Web P -*.webp - -# Portable Network Graphics -*.png - -# Animated Portable Network Graphics -*.apng - -# Multiple-image Network Graphics -*.mng - -# Tagged Image File Format -*.tiff -*.tif - -# Scalable Vector Graphics -*.svg -*.svgz - -# Portable Document Format -*.pdf - -# X BitMap -*.xbm - -# BMP -*.bmp -*.dib - -# ICO -*.ico - -# 3D Images -*.3dm -*.max - ## https://raw.githubusercontent.com/github/gitignore/main/Global/Linux.gitignore *~ @@ -328,6 +262,164 @@ xcuserdata/ ## S/MIME message *.smime +## https://raw.githubusercontent.com/github/gitignore/main/Go.gitignore + +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work +go.work.sum + +## https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + ## https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore # Byte-compiled / optimized / DLL files @@ -438,8 +530,10 @@ ipython_config.py #pdm.lock # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # in version control. -# https://pdm.fming.dev/#use-with-ide +# https://pdm.fming.dev/latest/usage/project/#working-with-version-control .pdm.toml +.pdm-python +.pdm-build/ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ @@ -528,30 +622,6 @@ override.tf.json .terraformrc terraform.rc -## https://raw.githubusercontent.com/github/gitignore/main/Go.gitignore - -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work - # Custom ignores for Go projects .build/ .tools/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2eda67a..1d90715 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,12 +10,17 @@ default_install_hook_types: repos: # https://github.com/pre-commit/pre-commit-hooks/tags - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.5.0" + rev: "v4.6.0" hooks: - id: check-added-large-files - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json + exclude: | + (?x)^( + \.vscode/.*\.json| + \.eslintrc\.json + )$ - id: check-merge-conflict - id: check-shebang-scripts-are-executable - id: check-symlinks @@ -31,16 +36,21 @@ repos: - id: trailing-whitespace exclude: "^.gitignore$" - # https://github.com/pre-commit/mirrors-prettier/tags - - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + # https://github.com/prettier/prettier/tags + - repo: local hooks: - id: prettier + name: prettier + entry: prettier --write --list-different --ignore-unknown + language: node + types: [text] exclude: "^project/" + additional_dependencies: + - "prettier@3.3.2" # https://github.com/igorshubovych/markdownlint-cli/tags - repo: https://github.com/igorshubovych/markdownlint-cli - rev: "v0.39.0" + rev: "v0.41.0" hooks: - id: markdownlint-fix name: markdownlint @@ -54,38 +64,27 @@ repos: # https://github.com/pecigonzalo/pre-commit-shfmt/tags - repo: https://github.com/pecigonzalo/pre-commit-shfmt - rev: "v2.1.0" + rev: "v2.2.0" hooks: - id: shell-fmt-go # https://github.com/koalaman/shellcheck-precommit/tags - repo: https://github.com/koalaman/shellcheck-precommit - rev: "v0.9.0" + rev: "v0.10.0" hooks: - id: shellcheck name: shellcheck # https://github.com/rhysd/actionlint/tags - repo: https://github.com/rhysd/actionlint - rev: "v1.6.26" + rev: "v1.7.1" hooks: - id: actionlint-docker name: actionlint - # https://github.com/antonbabenko/pre-commit-terraform/tags - - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: "v1.87.1" - hooks: - - id: terraform_fmt - name: terraform-fmt - - id: terraform_validate - name: terraform-validate - args: - - --hook-config=--parallelism-limit=1 - # https://github.com/bridgecrewio/checkov/tags - repo: https://github.com/bridgecrewio/checkov - rev: "3.2.22" + rev: "3.2.140" hooks: - id: checkov name: checkov @@ -103,3 +102,12 @@ repos: hooks: - id: woke-from-source args: [--config=.woke.yaml] + + # https://github.com/antonbabenko/pre-commit-terraform/tags + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: "v1.91.0" + hooks: + - id: terraform_fmt + name: terraform-fmt + - id: terraform_validate + name: terraform-validate diff --git a/.prettierignore b/.prettierignore index d2ab856..02a396d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ # auto generated .copier-answers.yml +.pnp.loader.mjs diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..ecc0db2 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,11 @@ +module.exports = { + bracketSameLine: false, + printWidth: 120, + semi: true, + trailingComma: "all", + singleQuote: false, + bracketSpacing: true, + arrowParens: "avoid", + useTabs: false, + tabWidth: 2, +}; diff --git a/.vscode/extensions.json b/.vscode/extensions.json index b52628c..c0cebfe 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,10 @@ { "recommendations": [ "aaron-bond.better-comments", + "arcanis.vscode-zipfs", "bierner.markdown-emoji", "DavidAnson.vscode-markdownlint", "DotJoshJohnson.xml", - "eamodio.gitlens", "esbenp.prettier-vscode", "github.vscode-github-actions", "GitHub.vscode-pull-request-github", @@ -12,11 +12,9 @@ "mkhl.direnv", "mkhl.shfmt", "ms-azuretools.vscode-docker", - "ms-vscode.cpptools-extension-pack", "ms-vscode.makefile-tools", "redhat.vscode-yaml", "samuelcolvin.jinjahtml", - "sharat.vscode-brewfile", "tamasfe.even-better-toml", "timonwong.shellcheck", "wholroyd.jinja", diff --git a/.vscode/settings.json b/.vscode/settings.json index 3c24a27..9f56389 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,6 @@ "editor.formatOnSave": true, "files.insertFinalNewline": true, "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true + "files.trimTrailingWhitespace": true, + "prettier.requireConfig": true } diff --git a/Makefile b/Makefile index ca3914c..dfa2f29 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,10 @@ update:: ## update environment and dependencies generate:: ## generate documentation, configuration, schemas, etc @: +.PHONY: format +format:: ## run formatters on source code + @: + .PHONY: check check:: ## run formatters and linters @: @@ -53,6 +57,10 @@ test:: ## run unit and integration tests build:: ## run build steps and create artifact @: +.PHONY: run +run:: ## run build artifact locally in development mode + @: + .PHONY: clean clean:: ## remove build artifacts and caches @: @@ -86,15 +94,30 @@ update:: copier-update pre-commit-install: ## install pre-commit hook pre-commit install -t pre-commit -t prepare-commit-msg -t commit-msg +.PHONY: pre-commit-format +pre-commit-format: ## run pre commit hooks +pre-commit-format: pre-commit-check +format:: pre-commit-format + .PHONY: pre-commit-check pre-commit-check: ## run pre commit hooks pre-commit run --all-files check:: pre-commit-check .PHONY: pre-commit-clean -pre-commit-clean: ## remove pre-commit and cached repositories +pre-commit-clean: ## remove pre-commit hook pre-commit uninstall - pre-commit clean clean:: pre-commit-clean -include *.mk + +## legacy compatibility targets + +.PHONY: dep +dep: install + +.PHONY: fmt +fmt: format + +.PHONY: lint +lint: check diff --git a/compass.yaml b/compass.yaml deleted file mode 100644 index 24b4fbc..0000000 --- a/compass.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: terraform-modules -description: Terraform Modules -configVersion: 1 -typeId: OTHER -ownerId: ari:cloud:teams::team/aa671d39-0e9e-45f1-87eb-44533a6f9f4c -fields: - lifecycle: Active - tier: 4 -links: - - name: null - type: REPOSITORY - url: "https://github.com/remerge/terraform-modules" - - name: "" - type: CHAT_CHANNEL - url: "https://remerge.slack.com/archives/C058W7TD90U" - - name: "" - type: PROJECT - url: "https://remerge.atlassian.net/browse/CORE" - - name: "" - type: ON_CALL - url: "https://remerge.app.opsgenie.com/settings/schedule/detail/1a0808b9-5d0c-41bb-9cb8-2b86479aaeab" - - name: README - type: DOCUMENT - url: "https://github.com/remerge/terraform-modules#readme" -relationships: - DEPENDS_ON: - # template - - ari:cloud:compass:1f02c36b-a506-45d6-bf3b-c800a6bbcfa5:component/27e24933-56f2-4b79-98cf-256bc22a164a/46894632-4cd4-405e-ab0e-f02f09ad5ac0 -labels: - - terraform-module - - apache-2.0