forked from antonbabenko/pre-commit-terraform
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rebase to upstream #16
Merged
Merged
Changes from all commits
Commits
Show all changes
221 commits
Select commit
Hold shift + click to select a range
97a6686
Added terraform-docs integration (#13)
antonbabenko 8e03aec
Run terraform_docs only if README.md is present
antonbabenko 091f8b1
Run terraform_docs only if README.md is present
antonbabenko 6b06683
Fixes use of md5 for tempfile name (#16)
brainsik 2d3782c
Replace terraform_docs use of GNU sed with perl (#15)
brainsik 69039c3
Only run validate if .tf files exist in the directory. (#20)
robinbowes 8dd603b
Updated README
antonbabenko b7c5094
Added license file (fixed #21)
antonbabenko fbdd40a
Add feature to pass options to terraform-docs.
metmajer 2b71d4b
Merge pull request #25 from getcloudnative/feat-pass-terraform-docs-opts
antonbabenko e2760ca
Added followup after #25
antonbabenko 7acd99e
Merge remote-tracking branch 'origin/master' into pr25
antonbabenko 9aa971c
Add new hook for running terraform-docs with replacing README.md from…
RothAndrew debe93a
Address requested changes
RothAndrew cbd26b2
Add `--dest` argument
RothAndrew d3fe87d
Address requested changes
RothAndrew fe3ba02
fix typo
RothAndrew a52b507
Merge pull request #27 from RothAndrew/feature/new_hook
antonbabenko 15c9f39
Fix bug not letting terraform_docs_replace work in the root directory…
RothAndrew 3cdf8ec
Merge pull request #30 from RothAndrew/feature/fix_issue_29
antonbabenko 57d924d
Require terraform-docs runs in serial to avoid pre-commit doing paral…
1750003
Merge pull request #33 from chrisgilmerproj/run_terraform_docs_in_serial
antonbabenko bc0e68b
Added chglog (hi @robinbowes :))
antonbabenko 66214dc
Added CHANGELOG.md
antonbabenko beb4a67
Add exit code for 'terraform validate' so pre-commit check fails (#34)
josiahhalme 2c842d9
Bump new version
antonbabenko a3771b5
fix check for errors at the end (#35)
supertylerc 7eb9ca3
Updated changelog
antonbabenko 249c02b
Update README.md (#36)
418a5ec
Fixed broken "maintained badge"
antonbabenko 5725b11
Added note about incompatibility of terraform-docs with Terraform 0.1…
antonbabenko dbf9108
Updated CHANGELOG
antonbabenko 8cddce3
Added support for terraform_docs for Terraform 0.12 (#45)
antonbabenko 9300d0f
Updated CHANGELOG
antonbabenko 35e0356
Upgraded to work with Terraform >= 0.12 (#44)
krzyzakp 060249f
Updated CHANGELOG
antonbabenko d678da9
Fix version in README.md (#46)
lwille 10854fc
Fixed awk script for terraform-docs (kudos @cytopia) and mktemp on Ma…
antonbabenko 59ffa65
Updated CHANGELOG
antonbabenko c9ecd72
Add slash to mktemp dir (fixed #50)
antonbabenko 5d8d926
Updated CHANGELOG
antonbabenko 3147a7c
Fix typo in README (#51)
eric-gonzales 8362915
Fixed enquoted types in terraform_docs (fixed #52)
antonbabenko 4bebeac
Updated CHANGELOG
antonbabenko d8dfc2c
Formatter for Terragrunt HCL files (#60)
sc250024 7eb805f
Updated README with terragrunt_fmt hook
antonbabenko dc8cf48
Updated CHANGELOG
antonbabenko e0d3d61
Added support for TFLint with --deep parameter (#53)
costingalan d5640fd
Updated README with terraform_tflint hook
antonbabenko c823172
Updated CHANGELOG
antonbabenko a7b730a
Update rev in README.md (#70)
davegallant eec9c88
Improve installation instructions and make README more readable (#72)
MaxymVlasov 657ce4e
Added FUNDING.yml
antonbabenko 6ffc42a
Fixes #65: terraform-docs should not fail if complex types contain 'd…
cytopia cbf2458
Updated CHANGELOG
antonbabenko 8bddc8b
use getopt for args in the tflint hook, following the approach in ter…
choppedpork 26ab873
Updated CHANGELOG
antonbabenko 76969ea
move terraform-docs args after markdown command (#83)
barryib 9fd71e3
Updated CHANGELOG
antonbabenko b99e350
Added support for terraform-docs 0.8.0 with proper support for Terraf…
konstantin-recurly 07730a4
Updated CHANGELOG
antonbabenko 1e5b3af
Added shfmt to autoformat shell scripts (#86)
antonbabenko 4734604
Updated CHANGELOG
antonbabenko e990429
Fixed tflint hook to iterate over files (#77)
robsonpeixoto 7f7ce9e
Updated CHANGELOG
antonbabenko 2ebb28a
Fixed exit code for terraform 0.11 branch in terraform_docs (#94)
antonbabenko 59e48e4
Updated pre-commit-hooks
antonbabenko e321ff1
Updated CHANGELOG
antonbabenko e402c03
corrected tflint documentation (#95)
grabcocque 0a75b5b
Updated CHANGELOG
antonbabenko 800756d
Update installation instructions (#79)
MaxymVlasov b0d4a68
Allow passing multiple args to terraform-docs (#98)
sergei-ivanov 8cbcd8e
Updated CHANGELOG
antonbabenko 7694fb9
fix: Change terraform_validate hook functionality for subdirectories …
mcdonnnj 29fa140
Updated CHANGELOG
antonbabenko 2be8fe5
feat: Support for TFSec (#103)
jon-proietti-nutrien 5bd4e2e
Updated pre-commit deps
antonbabenko 750e16d
Updated CHANGELOG
antonbabenko d174ca9
docs: Added coreutils as requirements in README.md (#105)
gchappel 85ec8a4
docs: Fixed the docs to use the latest config syntax(#106)
snolan-uturn 27e6369
fix: Updated formatting in README (closes #113)
antonbabenko 2e40ade
Updated CHANGELOG
antonbabenko f6caf21
feat: add terragrunt validate hook (#134)
prahaladramji dafe425
Updated CHANGELOG
antonbabenko 994653c
docs: Update terraform-docs link pointing to new organization (#130)
khos2ow 774c63e
fix: Pass args and env vars to terraform validate (#125)
robinbowes 0c5cbb3
Updated CHANGELOG
antonbabenko 1d8af37
chore: Use lib_getopt for all hooks and some style tweaks (#137)
robinbowes 861c116
Updated CHANGELOG
antonbabenko 6c77a6c
fix: Squash terraform_docs bug (#138)
robinbowes 2669065
Updated CHANGELOG
antonbabenko 108c75f
feat: have option for terraform_tfsec hook to only run in relevant mo…
nkazarian-spokeo c8c25ec
Updated CHANGELOG
antonbabenko 077c423
fix: make terraform_tfsec.sh executable (#140)
nkazarian-spokeo f2e3a5f
Updated CHANGELOG
antonbabenko f2cab31
fix: Correctly handle arrays in terraform_docs.sh (#141)
sergei-ivanov 45e16de
Updated CHANGELOG
antonbabenko 293b64c
feat: Add checkov support (#143)
antonbabenko e4ab410
Updated CHANGELOG
antonbabenko cf07b5e
feat: Add possibility to share tflint config file for subdirs (#149)
antonbabenko 4a61112
Updated CHANGELOG
antonbabenko 6f3b125
fix: terraform-docs version 0.10 removed with-aggregate-type-defaults…
antonbabenko cc4e5e8
Updated CHANGELOG
antonbabenko 81770aa
fix: make terraform_docs Windows compatible (#129)
matiaszilli 6b03062
Updated CHANGELOG
antonbabenko d773f4a
fix: Fix regex considering terraform-docs v0.10.0 old (#151)
evanstoddard23 84374f6
Updated CHANGELOG
antonbabenko d303bff
feat: Make terraform_validate to run init if necessary (#158)
antonbabenko fe2d121
Updated CHANGELOG
antonbabenko 3a07570
fix: Correct deprecated parameter to terraform-docs (#156)
tolidano 4f6e849
Updated CHANGELOG
antonbabenko dc87b07
update to upstream hooks
mrwacky42 12f9675
Merge remote-tracking branch 'upstream/master' into rebase-to-upstream
mrwacky42 333b080
just report, do not error
mrwacky42 827af52
fix: Terraform validate for submodules (#172)
antonbabenko f189a11
Updated CHANGELOG
antonbabenko ad5dcca
docs: updates installs for macOS and ubuntu (#175)
mavogel 90d4521
fix: remove sed postprocessing from the terraform_docs_replace hook t…
choppedpork 47b80ec
Updated CHANGELOG
antonbabenko 53de833
docs: Added checkov install (#182)
mavogel 36a269f
chore: add dockerfile (#183)
mavogel 257824c
Updated CHANGELOG
antonbabenko bec7b5d
Update README.md
antonbabenko fa3859e
chore: Fix mistake on command (#185)
d27074b
fix: Fix and pin versions in Dockerfile (#193)
mavogel 96346e7
Updated CHANGELOG
antonbabenko fee2387
feat: Adds support for Terrascan (#195)
9b84f70
Updated CHANGELOG
antonbabenko c7d6d00
chore: Update Ubuntu install method (#198)
lvthillo 5daffe8
docs: Initial docs improvement (#218)
MaxymVlasov ce02f94
fix: Dockerized pre-commit-terraform (#219)
MaxymVlasov c920368
feat: Add mixed line ending check to prevent possible errors (#221)
MaxymVlasov 53a866e
feat: Add GH checks and templates (#222)
MaxymVlasov 7a8c6e1
chore: Updated GH stale action config (#223)
MaxymVlasov 4faee7b
fix: label auto-adding after label rename (#226)
MaxymVlasov b67dbd9
fix: trigger terraform-docs on changes in lock files (#228)
sergei-ivanov 299ef12
Updated CHANGELOG
antonbabenko ff54bb4
fix: remove dead code from terraform-docs script (#229)
sergei-ivanov cf6603c
chore: Add shfmt to workflow (#231)
MaxymVlasov 98a8e40
docs: Describe hooks usage and improve examples (#232)
MaxymVlasov 3bdcf51
fix: Dockerfile if INSTALL_ALL is not defined (#233)
balihb ce02cd1
feat: Add PATH outputs when TFLint found any problem (#234)
MaxymVlasov 3404eed
fix: terraform_tflint hook executes in a serial way to run less often…
jcollado c8fb408
docs: Add contributing guide and docs about performance tests (#235)
MaxymVlasov 013d308
docs: Make contributors more visible (#236)
MaxymVlasov f7e28e1
docs: Document terraform_tfsec args usage (#238)
MaxymVlasov d69e86d
feat: Add new hook for `terraform providers lock` operation (#173)
sergei-ivanov 884446e
Updated CHANGELOG
antonbabenko 3ae5eb0
chore: Do not mark issues and PR's in milestone as stale (#241)
MaxymVlasov 71f7c34
fix: TFSec outputs the same results multiple times (#237)
MaxymVlasov 8a6e4bf
docs: Add terraform_fmt usage instructions and how-to debug script wi…
MaxymVlasov de2f624
feat: Allow passing of args to terraform_fmt (#147)
robinbowes e6aad17
docs: Document hooks dependencies (#247)
MaxymVlasov 25cddd9
feat: Add support for specify terraform-docs config file (#244)
MaxymVlasov 3f66432
fix: terrafrom_tflint ERROR output for files located in repo root (#243)
MaxymVlasov 7b11401
feat: Add `terraform_docs` hook settings (#245)
MaxymVlasov 762f7b2
docs: fix deps (#249)
MaxymVlasov 390a264
fix: execute tflint once in no errors (#250)
MaxymVlasov e33c654
fix: command not found (#251)
MaxymVlasov c0b9b3c
docs: Add missing space in terrascan install cmd (#253)
dan-arnold 2973f85
feat: add __GIT_WORKING_DIR__ to tfsec (#255)
gravitybacklight a0f69e3
docs: fix protocol to prevent MITM (#257)
MaxymVlasov cc59119
feat: Set up PR reviewers automatically (#258)
MaxymVlasov cff42e6
feat: Add infracost_breakdown hook (#252)
MaxymVlasov 3d5a882
docs: Clarify docs for terraform_tfsec hook (#266)
MaxymVlasov 9656159
docs: Pre-release 1.53 (#267)
antonbabenko bb880b0
Updated CHANGELOG
antonbabenko 01a6170
fix: Fixed args expand in terraform_docs (#260)
MaxymVlasov 15cac90
docs: Added notes about sponsors (#268)
antonbabenko e2604ea
feat: Add support for quoted values in `infracost_breakdown` `--hook-…
MaxymVlasov cf0844c
Updated CHANGELOG
antonbabenko 4c50943
fix: Fixed 1.54.0 where `terraform_docs` was broken (#272)
MaxymVlasov 57b94a2
Updated CHANGELOG
antonbabenko 32dae32
chore: Updated messages shown in terraform_tflint hook (#274)
MaxymVlasov 71302a9
feat: Updated Docker image from Ubuntu to Alpine (#278)
MaxymVlasov d4ae82f
Updated CHANGELOG
antonbabenko af10d4f
chore: Add deprecation notice to `terraform_docs_replace` (#280)
MaxymVlasov feabecc
fix: typo in arg name for terraform-docs (#283)
mj3c c5bcad4
Updated CHANGELOG
antonbabenko 3b4be67
chore: Fix master merge to working branch on pre-commit autofixes (#286)
MaxymVlasov 003cd1d
chore: Publish container image on release (#285)
MindTooth 6a064b1
Updated CHANGELOG
antonbabenko 4543f10
fix: Fixed docker build (#288)
sg70 31e7ccf
Updated CHANGELOG
antonbabenko 01d262c
fix: pre-build docker image (#292)
MaxymVlasov 141f815
Updated CHANGELOG
antonbabenko 7c6ad7c
fix: analyse all folders with tflint and don't stop on first executio…
bmbferreira 45575c3
feat: Pass custom arguments to terraform init in `terraform_validate`…
maxbrunet 00a5ef0
Updated CHANGELOG
antonbabenko 1bcca44
feat: Added semantic release (#296)
antonbabenko e1bccb7
chore(release): version 1.62.0 [skip ci]
semantic-release-bot 8c063c7
chore: Validate PR title (#297)
antonbabenko b8f90bd
chore: Updated validation PR title types (#298)
antonbabenko 21185f6
chore: Fixed allowed types for PR titles
antonbabenko 59da4b8
chore: Publish container image only after the release
antonbabenko 93029dc
fix(terraform_tflint): Restore current working directory behavior (#302)
maxbrunet 77bd661
chore: Use valid token for the Release GHA
antonbabenko d826474
chore(release): version 1.62.1 [skip ci]
semantic-release-bot b431a43
fix: Properly exclude .terraform directory with checkov hook (#306)
MaxymVlasov 2e8dcf9
fix: Speedup `terrascan` hook up to x3 times in big repos (#307)
MaxymVlasov 0962458
chore: Release action should track hooks configuration changes (#308)
MaxymVlasov 04ecd10
chore(release): version 1.62.2 [skip ci]
semantic-release-bot 66401d9
fix: Check all directories with changes and pass all args in terrasca…
carlosbustillordguez ac9299c
chore(release): version 1.62.3 [skip ci]
semantic-release-bot 1f16f09
chore: Refactor all hooks (#310)
MaxymVlasov 645f3fd
chore: Cleanup file with test data (#311)
MaxymVlasov 3045dd5
chore: Add shellcheck and make checks passing (#315)
MaxymVlasov c5f2a61
chore: Improved code structure (moved hooks into a separate dir) (#316)
MaxymVlasov 661a0cf
chore: Specify what we exactly mean (#320)
MaxymVlasov 321fb16
chore: Document functions (based on google style guide) (#317)
MaxymVlasov 4722900
chore: Add hadolint check for Dockerfiles (#322)
MaxymVlasov 71647bb
chore: Add Github Actions Workflow to build if Dockerfile updated (#318)
mohitsaxenaknoldus 441e87a
docs: Add workaround for configuration_aliases tf bug (#332)
mbainter a80d383
chore: fix bug intoduced in #316 (#335)
MaxymVlasov 7e7c916
feat: Improve performance during `pre-commit --all (-a)` run (#327)
carlosbustillordguez c266d40
chore(release): version 1.63.0 [skip ci]
semantic-release-bot 579dc45
feat: Improved speed of `pre-commit run -a` for multiple hooks (#338)
MaxymVlasov c2d1a58
chore(release): version 1.64.0 [skip ci]
semantic-release-bot e88abb6
chore: Fix docker test workflow (#340)
MaxymVlasov 458fb28
chore: Add Docker latest and nightly tag (#343)
pasqualedevita 4aaef7e
Merge remote-tracking branch 'upstream/master' into rebase-to-upstream
mrwacky42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* | ||
!.dockerignore | ||
!Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{*.{py,md},Dockerfile}] | ||
indent_size = 4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @maxymvlasov @yermulnik | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# Notes for contributors | ||
|
||
1. Python hooks are supported now too. All you have to do is: | ||
1. add a line to the `console_scripts` array in `entry_points` in `setup.py` | ||
2. Put your python script in the `pre_commit_hooks` folder | ||
|
||
Enjoy the clean, valid, and documented code! | ||
|
||
* [Run and debug hooks locally](#run-and-debug-hooks-locally) | ||
* [Run hook performance test](#run-hook-performance-test) | ||
* [Run via BASH](#run-via-bash) | ||
* [Run via Docker](#run-via-docker) | ||
* [Check results](#check-results) | ||
* [Cleanup](#cleanup) | ||
* [Add new hook](#add-new-hook) | ||
* [Before write code](#before-write-code) | ||
* [Prepare basic documentation](#prepare-basic-documentation) | ||
* [Add code](#add-code) | ||
* [Finish with the documentation](#finish-with-the-documentation) | ||
|
||
## Run and debug hooks locally | ||
|
||
```bash | ||
pre-commit try-repo {-a} /path/to/local/pre-commit-terraform/repo {hook_name} | ||
``` | ||
|
||
I.e. | ||
|
||
```bash | ||
pre-commit try-repo /mnt/c/Users/tf/pre-commit-terraform terraform_fmt # Run only `terraform_fmt` check | ||
pre-commit try-repo -a ~/pre-commit-terraform # run all existing checks from repo | ||
``` | ||
|
||
Running `pre-commit` with `try-repo` ignores all arguments specified in `.pre-commit-config.yaml`. | ||
|
||
If you need to test hook with arguments, follow [pre-commit doc](https://pre-commit.com/#arguments-pattern-in-hooks) to test hooks. | ||
|
||
For example, to test that the [`terraform_fmt`](../README.md#terraform_fmt) hook works fine with arguments: | ||
|
||
```bash | ||
/tmp/pre-commit-terraform/terraform_fmt.sh --args=-diff --args=-write=false test-dir/main.tf test-dir/vars.tf | ||
``` | ||
|
||
## Run hook performance test | ||
|
||
To check is your improvement not violate performance, we have dummy execution time tests. | ||
|
||
Script accept next options: | ||
<!-- markdownlint-disable no-inline-html --> | ||
| # | Name | Example value | Description | | ||
| --- | ---------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------- | | ||
| 1 | `TEST_NUM` | `200` | How many times need repeat test | | ||
| 2 | `TEST_COMMAND` | `'pre-commit try-repo -a /tmp/159/pre-commit-terraform terraform_tfsec'` | Valid pre-commit command | | ||
| 3 | `TEST_DIR` | `'/tmp/infrastructure'` | Dir on what you run tests. | | ||
| 4 | `TEST_DESCRIPTION` | ```'`terraform_tfsec` PR #123:'``` | Text that you'd like to see in result | | ||
| 5 | `RAW_TEST_`<br>`RESULTS_FILE_NAME` | `terraform_tfsec_pr123` | (Temporary) File where all test data will be stored. | | ||
<!-- markdownlint-enable no-inline-html --> | ||
|
||
> **Note:** To make test results repeatable and comparable, be sure that on the test machine nothing generates an unstable workload. During tests good to stop any other apps and do not interact with the test machine. | ||
> | ||
> Otherwise, for eg, when you watch Youtube videos during one test and not during other, test results can differ up to 30% for the same test. | ||
|
||
### Run via BASH | ||
|
||
```bash | ||
# Install deps | ||
sudo apt install -y datamash | ||
# Run tests | ||
./hooks_performance_test.sh 200 'pre-commit try-repo -a /tmp/159/pre-commit-terraform terraform_tfsec' '/tmp/infrastructure' '`terraform_tfsec` v1.51.0:' 'terraform_tfsec_pr159' | ||
``` | ||
|
||
### Run via Docker | ||
|
||
```bash | ||
# Build `pre-commit-terraform` image | ||
docker build -t pre-commit-terraform --build-arg INSTALL_ALL=true . | ||
# Build test image | ||
docker build -t pre-commit-tests tests/ | ||
# Run | ||
TEST_NUM=1 | ||
TEST_DIR='/tmp/infrastructure' | ||
PRE_COMMIT_DIR="$(pwd)" | ||
TEST_COMMAND='pre-commit try-repo -a /pct terraform_tfsec' | ||
TEST_DESCRIPTION='`terraform_tfsec` v1.51.0:' | ||
RAW_TEST_RESULTS_FILE_NAME='terraform_tfsec_pr159' | ||
|
||
docker run -v "$PRE_COMMIT_DIR:/pct:rw" -v "$TEST_DIR:/lint:ro" pre-commit-tests \ | ||
$TEST_NUM "$TEST_COMMAND" '/lint' "$RAW_TEST_RESULTS_FILE_NAME" "$RAW_TEST_RESULTS_FILE_NAME" | ||
``` | ||
|
||
### Check results | ||
|
||
Results will be located at `./test/results` dir. | ||
|
||
### Cleanup | ||
|
||
```bash | ||
sudo rm -rf tests/results | ||
``` | ||
|
||
## Add new hook | ||
|
||
You can use [this PR](https://github.com/antonbabenko/pre-commit-terraform/pull/252) as an example. | ||
|
||
### Before write code | ||
|
||
1. Try to figure out future hook usage. | ||
2. Confirm the concept with [Anton Babenko](https://github.com/antonbabenko). | ||
|
||
### Prepare basic documentation | ||
|
||
1. Identify and describe dependencies in [Install dependencies](../README.md#1-install-dependencies) and [Available Hooks](../README.md#available-hooks) sections | ||
|
||
### Add code | ||
|
||
1. Based on prev. block, add hook dependencies installation to [Dockerfile](../Dockerfile). | ||
Check that works: | ||
* `docker build -t pre-commit --build-arg INSTALL_ALL=true .` | ||
* `docker build -t pre-commit --build-arg <NEW_HOOK>_VERSION=latest .` | ||
* `docker build -t pre-commit --build-arg <NEW_HOOK>_VERSION=<1.2.3> .` | ||
2. Add new hook to [`.pre-commit-hooks.yaml`](../.pre-commit-hooks.yaml) | ||
3. Create hook file. Don't forget to make it executable via `chmod +x /path/to/hook/file`. | ||
4. Test hook. How to do it is described in [Run and debug hooks locally](#run-and-debug-hooks-locally) section. | ||
5. Test hook one more time. | ||
1. Push commit with hook file to GitHub | ||
2. Grab SHA hash of the commit | ||
3. Test hook using `.pre-commit-config.yaml`: | ||
|
||
```yaml | ||
repos: | ||
- repo: https://github.com/antonbabenko/pre-commit-terraform # Your repo | ||
rev: 3d76da3885e6a33d59527eff3a57d246dfb66620 # Your commit SHA | ||
hooks: | ||
- id: terraform_docs # New hook name | ||
args: | ||
- --args=--config=.terraform-docs.yml # Some args that you'd like to test | ||
``` | ||
|
||
### Finish with the documentation | ||
|
||
1. Add hook description to [Available Hooks](../README.md#available-hooks). | ||
2. Create and populate a new hook section in [Hooks usage notes and examples](../README.md#hooks-usage-notes-and-examples). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: [antonbabenko] | ||
custom: https://www.paypal.me/antonbabenko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
name: Docker bug report | ||
about: Create a bug report | ||
labels: | ||
- bug | ||
- area/docker | ||
--- | ||
|
||
<!-- | ||
Thank you for helping to improve pre-commit-terraform! | ||
|
||
Please be sure to search for open issues before raising a new one. We use issues | ||
for bug reports and feature requests. Please note, this template is for bugs | ||
report, not feature requests. | ||
--> | ||
|
||
### Describe the bug | ||
|
||
<!-- | ||
Please let us know what behavior you expected and how terraform-docs diverged | ||
from that behavior. | ||
--> | ||
|
||
|
||
### How can we reproduce it? | ||
|
||
<!-- | ||
Help us to reproduce your bug as succinctly and precisely as possible. Any and | ||
all steps or script that triggers the issue are highly appreciated! | ||
|
||
Do you have long logs to share? Please use collapsible sections, that can be created via: | ||
|
||
<details><summary>SECTION_NAME</summary> | ||
|
||
```bash | ||
YOUR_LOG_HERE | ||
``` | ||
|
||
</details> | ||
--> | ||
|
||
|
||
### Environment information | ||
|
||
* OS: | ||
|
||
<!-- I.e.: | ||
OS: Windows 10 | ||
OS: Win10 with Ubuntu 20.04 on WSL2 | ||
OS: MacOS | ||
OS: Ubuntu 20.04 | ||
--> | ||
|
||
* `docker info`: | ||
|
||
<details><summary><code>command output</summary> | ||
|
||
```bash | ||
INSERT_OUTPUT_HERE | ||
``` | ||
|
||
</details> | ||
|
||
* Docker image tag/git commit: | ||
|
||
* Tools versions. Don't forget to specify right tag in command - | ||
`TAG=latest && docker run --entrypoint cat pre-commit:$TAG /usr/bin/tools_versions_info` | ||
|
||
```bash | ||
INSERT_OUTPUT_HERE | ||
``` | ||
|
||
* `.pre-commit-config.yaml`: | ||
|
||
<details><summary>file content</summary> | ||
|
||
```bash | ||
INSERT_FILE_CONTENT_HERE | ||
``` | ||
|
||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
name: Local installation bug report | ||
about: Create a bug report | ||
labels: | ||
- bug | ||
- area/local_installation | ||
--- | ||
|
||
<!-- | ||
Thank you for helping to improve pre-commit-terraform! | ||
|
||
Please be sure to search for open issues before raising a new one. We use issues | ||
for bug reports and feature requests. Please note, this template is for bugs | ||
report, not feature requests. | ||
--> | ||
|
||
### Describe the bug | ||
|
||
<!-- | ||
Please let us know what behavior you expected and how terraform-docs diverged | ||
from that behavior. | ||
--> | ||
|
||
|
||
### How can we reproduce it? | ||
|
||
<!-- | ||
Help us to reproduce your bug as succinctly and precisely as possible. Any and | ||
all steps or script that triggers the issue are highly appreciated! | ||
|
||
Do you have long logs to share? Please use collapsible sections, that can be created via: | ||
|
||
<details><summary>SECTION_NAME</summary> | ||
|
||
```bash | ||
YOUR_LOG_HERE | ||
``` | ||
|
||
</details> | ||
--> | ||
|
||
|
||
### Environment information | ||
|
||
* OS: | ||
<!-- I.e.: | ||
OS: Windows 10 | ||
OS: Win10 with Ubuntu 20.04 on WSL2 | ||
OS: MacOS | ||
OS: Ubuntu 20.04 | ||
--> | ||
|
||
* `uname -a` and/or `systeminfo | Select-String "^OS"` output: | ||
|
||
```bash | ||
INSERT_OUTPUT_HERE | ||
``` | ||
|
||
<!-- I.e.: | ||
```bash | ||
PS C:\Users\vm> systeminfo | Select-String "^OS" | ||
|
||
OS Name: Microsoft Windows 10 Pro | ||
OS Version: 10.0.19043 N/A Build 19043 | ||
OS Manufacturer: Microsoft Corporation | ||
OS Configuration: Standalone Workstation | ||
OS Build Type: Multiprocessor Free | ||
|
||
$ uname -a | ||
Linux DESKTOP-C7315EF 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux | ||
``` | ||
--> | ||
|
||
* Tools availability and versions: | ||
|
||
<!-- For check all needed version run next script: | ||
|
||
$0 << EOF | ||
pre-commit --version 2>/dev/null || echo "pre-commit SKIPPED" | ||
terraform --version | head -n 1 2>/dev/null || echo "terraform SKIPPED" | ||
python --version 2>/dev/null || echo "python SKIPPED" | ||
python3 --version 2>/dev/null || echo "python3 SKIPPED" | ||
echo -n "checkov " && checkov --version 2>/dev/null || echo "checkov SKIPPED" | ||
terraform-docs --version 2>/dev/null || echo "terraform-docs SKIPPED" | ||
terragrunt --version 2>/dev/null || echo "terragrunt SKIPPED" | ||
echo -n "terrascan " && terrascan version 2>/dev/null || echo "terrascan SKIPPED" | ||
tflint --version 2>/dev/null || echo "tflint SKIPPED" | ||
echo -n "tfsec " && tfsec --version 2>/dev/null || echo "tfsec SKIPPED" | ||
EOF | ||
|
||
--> | ||
|
||
```bash | ||
INSERT_TOOLS_VERSIONS_HERE | ||
``` | ||
|
||
|
||
* `.pre-commit-config.yaml`: | ||
|
||
<details><summary>file content</summary> | ||
|
||
```bash | ||
INSERT_FILE_CONTENT_HERE | ||
``` | ||
|
||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
labels: | ||
- feature | ||
--- | ||
|
||
<!-- | ||
Thank you for helping to improve pre-commit-terraform! | ||
|
||
Please be sure to search for open issues before raising a new one. We use issues | ||
for bug reports and feature requests. Please note, this template is for feature | ||
requests, not bugs report. | ||
--> | ||
|
||
### What problem are you facing? | ||
|
||
<!-- | ||
Please tell us a little about your use case - it's okay if it's hypothetical! | ||
Leading with this context helps frame the feature request so we can ensure we | ||
implement it sensibly. | ||
---> | ||
|
||
|
||
### How could pre-commit-terraform help solve your problem? | ||
|
||
<!-- | ||
Let us know how you think pre-commit-terraform could help with your use case. | ||
--> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: should codeowners be us? I don't know who these people are. Or is it because we are using someoneelses code we need to keep them here?