Skip to content

Commit d580e8e

Browse files
author
Steven Nemetz
committed
Update doc. Add more git pre-commits
1 parent fe8c32a commit d580e8e

File tree

4 files changed

+50
-13
lines changed

4 files changed

+50
-13
lines changed

.pre-commit-config.yaml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
1-
- repo: git://github.com/devops-workflow/pre-commit-terraform
2-
rev: v1.7.3
3-
hooks:
4-
- id: terraform_fmt
5-
- id: terraform_docs
1+
# See http://pre-commit.com for more information
2+
# See http://pre-commit.com/hooks.html for more hooks
3+
# To update to all latest tagged versions run:
4+
# pre-commit autoupdate
5+
# TODO: write dependencies install instructions and put in each of
6+
# my pre-commit repos. Decide where to put for others
7+
repos:
8+
- repo: git://github.com/devops-workflow/pre-commit-terraform
9+
# Requires: terraform, terraform-docs
10+
rev: v1.7.3
11+
hooks:
12+
- id: terraform_fmt
13+
- id: terraform_docs
14+
- repo: git://github.com/pre-commit/pre-commit-hooks
15+
rev: v1.2.3
16+
hooks:
17+
- id: check-merge-conflict
18+
- id: trailing-whitespace
19+
# - id: end-of-file-fixer
20+
- id: check-added-large-files
21+
- id: check-yaml
22+
# TODO: test these
23+
# check-json
24+
# pretty-format-json
25+
# detect-aws-credentials
26+
# detect-private-key
27+
#- repo: https://github.com/jumanjihouse/pre-commit-hooks
28+
# # Requires: shellcheck, shfmt
29+
# rev: 1.8.0
30+
# hooks:
31+
# - id: shellcheck
32+
# - id: shfmt
33+
#- repo: git://github.com/detailyang/pre-commit-shell
34+
# # Requires: shellcheck
35+
# rev: 1.0.2
36+
# hooks:
37+
# - id: shell-lint
38+
# TODO:
39+
# add bashate shell code style https://github.com/openstack-dev/bashate
40+
# gitlint https://github.com/jorisroovers/gitlint
41+
# Create new repo and hook for markdown linters

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# terraform-local-label
22

33
[![CircleCI](https://circleci.com/gh/devops-workflow/terraform-local-label.svg?style=svg)](https://circleci.com/gh/devops-workflow/terraform-local-label)
4+
[![Github release](https://img.shields.io/github/release/devops-workflow/terraform-local-label.svg)](https://github.com/devops-workflow/terraform-local-label/releases)
45

56
Terraform module to provide consistent label names and tags for resources.
67

@@ -91,8 +92,8 @@ module "label" {
9192
| environment | Environment (ex: `dev`, `qa`, `stage`, `prod`). (Second or top level namespace. Depending on namespacing options) | string | - | yes |
9293
| monitor | TAG: Should resource be monitored | string | `UNDEF` | no |
9394
| name | Base name for resource | string | - | yes |
94-
| namespace-env | Prefix name with the environment. If true, format is: <env>-<name> | string | `true` | no |
95-
| namespace-org | Prefix name with the organization. If true, format is: <org>-<env namespaced name>. If both env and org namespaces are used, format will be <org>-<env>-<name> | string | `false` | no |
95+
| namespace-env | Prefix name with the environment. If true, format is: `{env}-{name}` | string | `true` | no |
96+
| namespace-org | Prefix name with the organization. If true, format is: `{org}-{env namespaced name}`. If both env and org namespaces are used, format will be `{org}-{env}-{name}` | string | `false` | no |
9697
| organization | Organization name (Top level namespace) | string | `` | no |
9798
| owner | TAG: Owner of the service | string | `UNDEF` | no |
9899
| product | TAG: Company/business product | string | `UNDEF` | no |
@@ -111,8 +112,8 @@ module "label" {
111112
| id_32 | ID truncated to 32 characters |
112113
| id_attr_20 | ID max size 20 characters by truncating `id_org` then appending `attributes` |
113114
| id_attr_32 | ID max size 32 characters by truncating `id_org` then appending `attributes` |
114-
| id_env | If env namespace enabled `env-name` else `name` |
115-
| id_org | If org namespace enabled `org-id_env` else `id_env` |
115+
| id_env | If env namespace enabled `{env}-{name}` else `{name}` |
116+
| id_org | If org namespace enabled `{org}-{id_env}` else `{id_env}` |
116117
| name | Name lowercase |
117118
| org_attr_20 | Internal debugging. DO NOT USE |
118119
| org_attr_32 | Internal debugging. DO NOT USE |

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ output "id_attr_32" {
3434
}
3535

3636
output "id_env" {
37-
description = "If env namespace enabled `env-name` else `name`"
37+
description = "If env namespace enabled `{env}-{name}` else `{name}`"
3838
value = "${local.id_env}"
3939
}
4040

4141
output "id_org" {
42-
description = "If org namespace enabled `org-id_env` else `id_env`"
42+
description = "If org namespace enabled `{org}-{id_env}` else `{id_env}`"
4343
value = "${local.id_org}"
4444
}
4545

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ variable "name" {
3333
}
3434

3535
variable "namespace-env" {
36-
description = "Prefix name with the environment. If true, format is: <env>-<name>"
36+
description = "Prefix name with the environment. If true, format is: `{env}-{name}`"
3737
default = true
3838
}
3939

4040
variable "namespace-org" {
41-
description = "Prefix name with the organization. If true, format is: <org>-<env namespaced name>. If both env and org namespaces are used, format will be <org>-<env>-<name>"
41+
description = "Prefix name with the organization. If true, format is: `{org}-{env namespaced name}`. If both env and org namespaces are used, format will be `{org}-{env}-{name}`"
4242
default = false
4343
}
4444

0 commit comments

Comments
 (0)