Skip to content

pre-commit + commitizen + lint fixes #11

Merged
merged 36 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
01fe111
add operators_ns
morga471 Jul 31, 2024
e3c904b
repo features
morga471 Jul 31, 2024
720439a
fmt
morga471 Jul 31, 2024
93fd3fc
more
morga471 Jul 31, 2024
3e42428
remove disabled
morga471 Jul 31, 2024
f2b7943
lints
morga471 Aug 1, 2024
80f7e78
add terragrunt-cache to .gitignore
morga471 Aug 1, 2024
984f8b2
add tflint exception
morga471 Aug 1, 2024
d78710f
commented for ref
morga471 Aug 1, 2024
0d87a7e
👷 build(.cz.yaml): add commitizen config file >>> ⏰ 2h
morga471 Aug 1, 2024
d33b064
📝 docs(CHANGELOG.md): added a changelog by running cz ch >>> ⏰ 15m
morga471 Aug 1, 2024
0b40fcd
add dependabot
morga471 Aug 1, 2024
74983e2
Merge pull request #10 from SCT-Engineering/morga471-patch-1
morga471 Aug 1, 2024
78b82a5
💚 ci(.github/dependabot.yml): add dependabot for terraform
morga471 Aug 1, 2024
91f6e0f
💚 ci(test.yml): added test.yml to demonstrate how commitizen and pre-…
morga471 Aug 1, 2024
02c32a8
🐛 fix(dummy-vpc): add filter and tag for dummy-vpc
morga471 Aug 1, 2024
d748aa6
🐛 fix(dns_zones.tf): added cluster name tag to vpc
morga471 Aug 1, 2024
ba88ed6
📝 docs(changelog): moved old changelog to changelog.md
morga471 Aug 1, 2024
2922891
✨ feat(amazon-cloudwatch-observability): add cloudwatch addon instead…
morga471 Aug 1, 2024
fd61dce
🐛 fix(irsa_roles.tf): update vars from module
morga471 Aug 2, 2024
c0b914b
🐛 fix(irsa_roles.tf): use cannonical module ref
morga471 Aug 2, 2024
4c9554e
🐛 fix(main.tf): fix irsa_role ref from update >>> ⏰ 5m
morga471 Aug 2, 2024
7fd2843
🐛 fix(main.tf): update depends_on
morga471 Aug 2, 2024
c774f52
🐛 fix(main.tf): add short sleep after kube update
morga471 Aug 2, 2024
02c7895
🐛 fix(main.tf): removed invalied property >>> ⏰ 1m
morga471 Aug 2, 2024
0b0fd4a
🐛 fix(main.tf): add time_sleep before operators create
morga471 Aug 2, 2024
8074a4e
🐛 fix(main.tf): remove operators due to timing issues
morga471 Aug 2, 2024
23e9004
👷 build(cz): update cz to use scm for version
morga471 Aug 2, 2024
f1a898e
💚 ci(.cz.yaml): update commitizen to use scm for version
morga471 Aug 2, 2024
d88be89
✨ feat(main.tf): added adot, snapshot-controller, and updated docs
morga471 Aug 3, 2024
56d7e71
🐛 fix(main.tf): no adot avail for 1.30
morga471 Aug 3, 2024
c06cd15
📝 docs: update resource counts on apply/destroy
morga471 Aug 3, 2024
f4aeaf1
🔖 bump: version 0.0.0 → 0.1.0
morga471 Aug 3, 2024
a465cd5
📝 docs(versions.tf): bumped the version
morga471 Aug 5, 2024
62c579a
🚨 fix-lint(repo): responses to pr feedback - remove disabled code
morga471 Aug 6, 2024
725ccbe
🚨 fix-lint(.pre-commit-config.yaml): commented the terragrunt actions
morga471 Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
commitizen:
major_version_zero: true
name: cz_gitmoji
tag_format: $version
update_changelog_on_bump: true
version_provider: scm
version_scheme: semver2
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "terraform" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.terraform/
.terraform.lock.hcl
.terragrunt-cache/
99 changes: 99 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Git style
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: forbid-new-submodules
- id: no-commit-to-branch

# Common errors
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: CHANGELOG.md
- id: check-yaml
- id: check-merge-conflict
- id: check-executables-have-shebangs

# Cross platform
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]

# Security
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key

# JSON5 Linter
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
files: '.json5$'

# Terraform Hooks
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.92.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
hooks:
- id: terraform_fmt
args:
- --hook-config=--parallelism-ci-cpu-cores=2
- id: terraform_docs
args:
- --hook-config=--parallelism-ci-cpu-cores=2
- id: terraform_tflint
name: Terraform validate with tflint
description: Validates all Terraform configuration files with TFLint.
require_serial: true
entry: hooks/terraform_tflint.sh
language: script
files: (\.tf|\.tfvars)$
exclude: \.(terraform/.*|terragrunt-cache)$
args:
- --hook-config=--parallelism-ci-cpu-cores=2
- id: terragrunt_fmt
name: Terragrunt fmt
description: Rewrites all Terragrunt configuration files to a canonical format.
entry: hooks/terragrunt_fmt.sh
language: script
files: (\.hcl)$
exclude: \.(terraform/.*|terragrunt-cache)$
args:
- --hook-config=--parallelism-ci-cpu-cores=2
### DISABLED UNTIL MINIFIED TERRAGRUNT.HCL IS CREATED
# - id: terragrunt_validate
# name: Terragrunt validate
# description: Validates all Terragrunt configuration files.
# entry: hooks/terragrunt_validate.sh
# language: script
# files: (\.hcl)$
# exclude: \.(terraform/.*|terragrunt-cache)$
# args:
# - --hook-config=--parallelism-ci-cpu-cores=2
# - id: terragrunt_validate_inputs
# name: Terragrunt validate inputs
# description: Validates Terragrunt unused and undefined inputs.
# entry: hooks/terragrunt_validate_inputs.sh
# language: script
# files: (\.hcl)$
# exclude: \.(terraform/.*|terragrunt-cache)$
# args:
# - --hook-config=--parallelism-ci-cpu-cores=2
# - id: terragrunt_providers_lock
# name: Terragrunt providers lock
# description: Updates provider signatures in dependency lock files using terragrunt.
# entry: hooks/terragrunt_providers_lock.sh
# language: script
# files: (terragrunt|\.terraform\.lock)\.hcl$
# exclude: \.(terraform/.*|terragrunt-cache)$
# args:
# - --hook-config=--parallelism-ci-cpu-cores=2

- repo: https://github.com/ljnsn/cz-conventional-gitmoji
rev: v0.3.2
hooks:
- id: conventional-gitmoji
36 changes: 36 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"branches": [
"main",
"master"
],
"ci": false,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"successComment":
"This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file."
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
44 changes: 44 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
formatter: markdown table

header-from: main.tf
footer-from: ""

sections:
## hide: []
show:
- data-sources
- header
- footer
- inputs
- modules
- outputs
- providers
- requirements
- resources

output:
file: README.md
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
output-values:
enabled: false
from: ""

sort:
enabled: true
by: name

settings:
anchor: true
color: true
default: true
description: true
escape: true
indent: 2
required: true
sensitive: true
type: true
21 changes: 21 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
config {
module = true
force = false
disabled_by_default = false
}

rule "aws_instance_invalid_type" {
enabled = true
}

plugin "aws" {
enabled = true
version = "0.32.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

plugin "terraform" {
enabled = true
version = "0.9.0"
source = "github.com/terraform-linters/tflint-ruleset-terraform"
}
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 0.1.0 (2024-08-02)

### ✨ Features

- **main.tf**: added adot, snapshot-controller, and updated docs
- **amazon-cloudwatch-observability**: add cloudwatch addon instead of cloudwatch module

### 🐛🚑️ Fixes

- **main.tf**: no adot avail for 1.30
- **main.tf**: remove operators due to timing issues
- **main.tf**: add time_sleep before operators create
- **main.tf**: removed invalied property >>> ⏰ 1m
- **main.tf**: add short sleep after kube update
- **main.tf**: update depends_on
- **main.tf**: fix irsa_role ref from update >>> ⏰ 5m
- **irsa_roles.tf**: use cannonical module ref
- **irsa_roles.tf**: update vars from module
- **dns_zones.tf**: added cluster name tag to vpc
- **dummy-vpc**: add filter and tag for dummy-vpc

### 💚👷 CI & Build

- **.cz.yaml**: update commitizen to use scm for version
- **cz**: update cz to use scm for version
- **test.yml**: added test.yml to demonstrate how commitizen and pre-commit-hooks work >>> ⏰ 15m
- **.github/dependabot.yml**: add dependabot for terraform
- **.cz.yaml**: add commitizen config file >>> ⏰ 2h

### 📝💡 Documentation

- update resource counts on apply/destroy
- **changelog**: moved old changelog to changelog.md
- **CHANGELOG.md**: added a changelog by running cz ch >>> ⏰ 15m
Loading