Skip to content
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 221 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
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 May 16, 2018
8e03aec
Run terraform_docs only if README.md is present
antonbabenko May 16, 2018
091f8b1
Run terraform_docs only if README.md is present
antonbabenko May 16, 2018
6b06683
Fixes use of md5 for tempfile name (#16)
brainsik May 20, 2018
2d3782c
Replace terraform_docs use of GNU sed with perl (#15)
brainsik May 20, 2018
69039c3
Only run validate if .tf files exist in the directory. (#20)
robinbowes May 24, 2018
8dd603b
Updated README
antonbabenko May 24, 2018
b7c5094
Added license file (fixed #21)
antonbabenko Jul 10, 2018
fbdd40a
Add feature to pass options to terraform-docs.
metmajer Nov 13, 2018
2b71d4b
Merge pull request #25 from getcloudnative/feat-pass-terraform-docs-opts
antonbabenko Dec 11, 2018
e2760ca
Added followup after #25
antonbabenko Dec 11, 2018
7acd99e
Merge remote-tracking branch 'origin/master' into pr25
antonbabenko Dec 11, 2018
9aa971c
Add new hook for running terraform-docs with replacing README.md from…
RothAndrew Dec 14, 2018
debe93a
Address requested changes
RothAndrew Dec 14, 2018
cbd26b2
Add `--dest` argument
RothAndrew Dec 14, 2018
d3fe87d
Address requested changes
RothAndrew Dec 14, 2018
fe3ba02
fix typo
RothAndrew Dec 14, 2018
a52b507
Merge pull request #27 from RothAndrew/feature/new_hook
antonbabenko Dec 14, 2018
15c9f39
Fix bug not letting terraform_docs_replace work in the root directory…
RothAndrew Dec 14, 2018
3cdf8ec
Merge pull request #30 from RothAndrew/feature/fix_issue_29
antonbabenko Dec 15, 2018
57d924d
Require terraform-docs runs in serial to avoid pre-commit doing paral…
Feb 8, 2019
1750003
Merge pull request #33 from chrisgilmerproj/run_terraform_docs_in_serial
antonbabenko Feb 18, 2019
bc0e68b
Added chglog (hi @robinbowes :))
antonbabenko Feb 18, 2019
66214dc
Added CHANGELOG.md
antonbabenko Feb 18, 2019
beb4a67
Add exit code for 'terraform validate' so pre-commit check fails (#34)
josiahhalme Feb 21, 2019
2c842d9
Bump new version
antonbabenko Feb 21, 2019
a3771b5
fix check for errors at the end (#35)
supertylerc Mar 1, 2019
7eb9ca3
Updated changelog
antonbabenko Mar 1, 2019
249c02b
Update README.md (#36)
Mar 5, 2019
418a5ec
Fixed broken "maintained badge"
antonbabenko Apr 6, 2019
5725b11
Added note about incompatibility of terraform-docs with Terraform 0.1…
antonbabenko May 27, 2019
dbf9108
Updated CHANGELOG
antonbabenko May 27, 2019
8cddce3
Added support for terraform_docs for Terraform 0.12 (#45)
antonbabenko Jun 17, 2019
9300d0f
Updated CHANGELOG
antonbabenko Jun 17, 2019
35e0356
Upgraded to work with Terraform >= 0.12 (#44)
krzyzakp Jun 17, 2019
060249f
Updated CHANGELOG
antonbabenko Jun 17, 2019
d678da9
Fix version in README.md (#46)
lwille Jun 17, 2019
10854fc
Fixed awk script for terraform-docs (kudos @cytopia) and mktemp on Ma…
antonbabenko Jun 18, 2019
59ffa65
Updated CHANGELOG
antonbabenko Jun 18, 2019
c9ecd72
Add slash to mktemp dir (fixed #50)
antonbabenko Jun 18, 2019
5d8d926
Updated CHANGELOG
antonbabenko Jun 18, 2019
3147a7c
Fix typo in README (#51)
eric-gonzales Jun 19, 2019
8362915
Fixed enquoted types in terraform_docs (fixed #52)
antonbabenko Jun 25, 2019
4bebeac
Updated CHANGELOG
antonbabenko Jun 25, 2019
d8dfc2c
Formatter for Terragrunt HCL files (#60)
sc250024 Aug 20, 2019
7eb805f
Updated README with terragrunt_fmt hook
antonbabenko Aug 20, 2019
dc8cf48
Updated CHANGELOG
antonbabenko Aug 20, 2019
e0d3d61
Added support for TFLint with --deep parameter (#53)
costingalan Aug 20, 2019
d5640fd
Updated README with terraform_tflint hook
antonbabenko Aug 20, 2019
c823172
Updated CHANGELOG
antonbabenko Aug 20, 2019
a7b730a
Update rev in README.md (#70)
davegallant Oct 12, 2019
eec9c88
Improve installation instructions and make README more readable (#72)
MaxymVlasov Oct 17, 2019
657ce4e
Added FUNDING.yml
antonbabenko Nov 1, 2019
6ffc42a
Fixes #65: terraform-docs should not fail if complex types contain 'd…
cytopia Nov 2, 2019
cbf2458
Updated CHANGELOG
antonbabenko Nov 2, 2019
8bddc8b
use getopt for args in the tflint hook, following the approach in ter…
choppedpork Nov 16, 2019
26ab873
Updated CHANGELOG
antonbabenko Nov 16, 2019
76969ea
move terraform-docs args after markdown command (#83)
barryib Jan 13, 2020
9fd71e3
Updated CHANGELOG
antonbabenko Jan 13, 2020
b99e350
Added support for terraform-docs 0.8.0 with proper support for Terraf…
konstantin-recurly Jan 21, 2020
07730a4
Updated CHANGELOG
antonbabenko Jan 21, 2020
1e5b3af
Added shfmt to autoformat shell scripts (#86)
antonbabenko Jan 21, 2020
4734604
Updated CHANGELOG
antonbabenko Jan 21, 2020
e990429
Fixed tflint hook to iterate over files (#77)
robsonpeixoto Jan 30, 2020
7f7ce9e
Updated CHANGELOG
antonbabenko Jan 30, 2020
2ebb28a
Fixed exit code for terraform 0.11 branch in terraform_docs (#94)
antonbabenko Feb 21, 2020
59e48e4
Updated pre-commit-hooks
antonbabenko Feb 21, 2020
e321ff1
Updated CHANGELOG
antonbabenko Feb 21, 2020
e402c03
corrected tflint documentation (#95)
grabcocque Mar 2, 2020
0a75b5b
Updated CHANGELOG
antonbabenko Mar 2, 2020
800756d
Update installation instructions (#79)
MaxymVlasov Mar 18, 2020
b0d4a68
Allow passing multiple args to terraform-docs (#98)
sergei-ivanov Apr 4, 2020
8cbcd8e
Updated CHANGELOG
antonbabenko Apr 4, 2020
7694fb9
fix: Change terraform_validate hook functionality for subdirectories …
mcdonnnj Apr 4, 2020
29fa140
Updated CHANGELOG
antonbabenko Apr 4, 2020
2be8fe5
feat: Support for TFSec (#103)
jon-proietti-nutrien Apr 23, 2020
5bd4e2e
Updated pre-commit deps
antonbabenko Apr 23, 2020
750e16d
Updated CHANGELOG
antonbabenko Apr 23, 2020
d174ca9
docs: Added coreutils as requirements in README.md (#105)
gchappel Apr 29, 2020
85ec8a4
docs: Fixed the docs to use the latest config syntax(#106)
snolan-uturn Apr 29, 2020
27e6369
fix: Updated formatting in README (closes #113)
antonbabenko May 27, 2020
2e40ade
Updated CHANGELOG
antonbabenko May 27, 2020
f6caf21
feat: add terragrunt validate hook (#134)
prahaladramji Aug 19, 2020
dafe425
Updated CHANGELOG
antonbabenko Aug 19, 2020
994653c
docs: Update terraform-docs link pointing to new organization (#130)
khos2ow Aug 19, 2020
774c63e
fix: Pass args and env vars to terraform validate (#125)
robinbowes Aug 27, 2020
0c5cbb3
Updated CHANGELOG
antonbabenko Aug 27, 2020
1d8af37
chore: Use lib_getopt for all hooks and some style tweaks (#137)
robinbowes Aug 27, 2020
861c116
Updated CHANGELOG
antonbabenko Aug 27, 2020
6c77a6c
fix: Squash terraform_docs bug (#138)
robinbowes Aug 28, 2020
2669065
Updated CHANGELOG
antonbabenko Aug 28, 2020
108c75f
feat: have option for terraform_tfsec hook to only run in relevant mo…
nkazarian-spokeo Sep 1, 2020
c8c25ec
Updated CHANGELOG
antonbabenko Sep 1, 2020
077c423
fix: make terraform_tfsec.sh executable (#140)
nkazarian-spokeo Sep 1, 2020
f2e3a5f
Updated CHANGELOG
antonbabenko Sep 1, 2020
f2cab31
fix: Correctly handle arrays in terraform_docs.sh (#141)
sergei-ivanov Sep 7, 2020
45e16de
Updated CHANGELOG
antonbabenko Sep 7, 2020
293b64c
feat: Add checkov support (#143)
antonbabenko Sep 8, 2020
e4ab410
Updated CHANGELOG
antonbabenko Sep 8, 2020
cf07b5e
feat: Add possibility to share tflint config file for subdirs (#149)
antonbabenko Sep 22, 2020
4a61112
Updated CHANGELOG
antonbabenko Sep 22, 2020
6f3b125
fix: terraform-docs version 0.10 removed with-aggregate-type-defaults…
antonbabenko Sep 23, 2020
cc4e5e8
Updated CHANGELOG
antonbabenko Sep 23, 2020
81770aa
fix: make terraform_docs Windows compatible (#129)
matiaszilli Sep 24, 2020
6b03062
Updated CHANGELOG
antonbabenko Sep 24, 2020
d773f4a
fix: Fix regex considering terraform-docs v0.10.0 old (#151)
evanstoddard23 Sep 24, 2020
84374f6
Updated CHANGELOG
antonbabenko Sep 24, 2020
d303bff
feat: Make terraform_validate to run init if necessary (#158)
antonbabenko Nov 2, 2020
fe2d121
Updated CHANGELOG
antonbabenko Nov 2, 2020
3a07570
fix: Correct deprecated parameter to terraform-docs (#156)
tolidano Nov 12, 2020
4f6e849
Updated CHANGELOG
antonbabenko Nov 12, 2020
dc87b07
update to upstream hooks
mrwacky42 Nov 25, 2020
12f9675
Merge remote-tracking branch 'upstream/master' into rebase-to-upstream
mrwacky42 Nov 25, 2020
333b080
just report, do not error
mrwacky42 Nov 25, 2020
827af52
fix: Terraform validate for submodules (#172)
antonbabenko Feb 20, 2021
f189a11
Updated CHANGELOG
antonbabenko Feb 20, 2021
ad5dcca
docs: updates installs for macOS and ubuntu (#175)
mavogel Feb 25, 2021
90d4521
fix: remove sed postprocessing from the terraform_docs_replace hook t…
choppedpork Feb 25, 2021
47b80ec
Updated CHANGELOG
antonbabenko Feb 25, 2021
53de833
docs: Added checkov install (#182)
mavogel Mar 12, 2021
36a269f
chore: add dockerfile (#183)
mavogel Mar 12, 2021
257824c
Updated CHANGELOG
antonbabenko Mar 12, 2021
bec7b5d
Update README.md
antonbabenko Mar 18, 2021
fa3859e
chore: Fix mistake on command (#185)
Mar 24, 2021
d27074b
fix: Fix and pin versions in Dockerfile (#193)
mavogel Apr 20, 2021
96346e7
Updated CHANGELOG
antonbabenko Apr 20, 2021
fee2387
feat: Adds support for Terrascan (#195)
cesar-rodriguez Apr 22, 2021
9b84f70
Updated CHANGELOG
antonbabenko Apr 22, 2021
c7d6d00
chore: Update Ubuntu install method (#198)
lvthillo May 4, 2021
5daffe8
docs: Initial docs improvement (#218)
MaxymVlasov Sep 9, 2021
ce02f94
fix: Dockerized pre-commit-terraform (#219)
MaxymVlasov Sep 9, 2021
c920368
feat: Add mixed line ending check to prevent possible errors (#221)
MaxymVlasov Sep 10, 2021
53a866e
feat: Add GH checks and templates (#222)
MaxymVlasov Sep 11, 2021
7a8c6e1
chore: Updated GH stale action config (#223)
MaxymVlasov Sep 14, 2021
4faee7b
fix: label auto-adding after label rename (#226)
MaxymVlasov Sep 15, 2021
b67dbd9
fix: trigger terraform-docs on changes in lock files (#228)
sergei-ivanov Sep 17, 2021
299ef12
Updated CHANGELOG
antonbabenko Sep 17, 2021
ff54bb4
fix: remove dead code from terraform-docs script (#229)
sergei-ivanov Sep 20, 2021
cf6603c
chore: Add shfmt to workflow (#231)
MaxymVlasov Sep 29, 2021
98a8e40
docs: Describe hooks usage and improve examples (#232)
MaxymVlasov Sep 29, 2021
3bdcf51
fix: Dockerfile if INSTALL_ALL is not defined (#233)
balihb Sep 30, 2021
ce02cd1
feat: Add PATH outputs when TFLint found any problem (#234)
MaxymVlasov Sep 30, 2021
3404eed
fix: terraform_tflint hook executes in a serial way to run less often…
jcollado Oct 1, 2021
c8fb408
docs: Add contributing guide and docs about performance tests (#235)
MaxymVlasov Oct 1, 2021
013d308
docs: Make contributors more visible (#236)
MaxymVlasov Oct 1, 2021
f7e28e1
docs: Document terraform_tfsec args usage (#238)
MaxymVlasov Oct 1, 2021
d69e86d
feat: Add new hook for `terraform providers lock` operation (#173)
sergei-ivanov Oct 4, 2021
884446e
Updated CHANGELOG
antonbabenko Oct 4, 2021
3ae5eb0
chore: Do not mark issues and PR's in milestone as stale (#241)
MaxymVlasov Oct 14, 2021
71f7c34
fix: TFSec outputs the same results multiple times (#237)
MaxymVlasov Oct 14, 2021
8a6e4bf
docs: Add terraform_fmt usage instructions and how-to debug script wi…
MaxymVlasov Oct 14, 2021
de2f624
feat: Allow passing of args to terraform_fmt (#147)
robinbowes Oct 14, 2021
e6aad17
docs: Document hooks dependencies (#247)
MaxymVlasov Oct 15, 2021
25cddd9
feat: Add support for specify terraform-docs config file (#244)
MaxymVlasov Oct 15, 2021
3f66432
fix: terrafrom_tflint ERROR output for files located in repo root (#243)
MaxymVlasov Oct 15, 2021
7b11401
feat: Add `terraform_docs` hook settings (#245)
MaxymVlasov Oct 15, 2021
762f7b2
docs: fix deps (#249)
MaxymVlasov Oct 15, 2021
390a264
fix: execute tflint once in no errors (#250)
MaxymVlasov Oct 15, 2021
e33c654
fix: command not found (#251)
MaxymVlasov Oct 15, 2021
c0b9b3c
docs: Add missing space in terrascan install cmd (#253)
dan-arnold Oct 19, 2021
2973f85
feat: add __GIT_WORKING_DIR__ to tfsec (#255)
gravitybacklight Oct 21, 2021
a0f69e3
docs: fix protocol to prevent MITM (#257)
MaxymVlasov Oct 25, 2021
cc59119
feat: Set up PR reviewers automatically (#258)
MaxymVlasov Oct 25, 2021
cff42e6
feat: Add infracost_breakdown hook (#252)
MaxymVlasov Oct 26, 2021
3d5a882
docs: Clarify docs for terraform_tfsec hook (#266)
MaxymVlasov Oct 26, 2021
9656159
docs: Pre-release 1.53 (#267)
antonbabenko Oct 26, 2021
bb880b0
Updated CHANGELOG
antonbabenko Oct 26, 2021
01a6170
fix: Fixed args expand in terraform_docs (#260)
MaxymVlasov Oct 26, 2021
15cac90
docs: Added notes about sponsors (#268)
antonbabenko Oct 26, 2021
e2604ea
feat: Add support for quoted values in `infracost_breakdown` `--hook-…
MaxymVlasov Oct 27, 2021
cf0844c
Updated CHANGELOG
antonbabenko Oct 27, 2021
4c50943
fix: Fixed 1.54.0 where `terraform_docs` was broken (#272)
MaxymVlasov Oct 27, 2021
57b94a2
Updated CHANGELOG
antonbabenko Oct 27, 2021
32dae32
chore: Updated messages shown in terraform_tflint hook (#274)
MaxymVlasov Oct 29, 2021
71302a9
feat: Updated Docker image from Ubuntu to Alpine (#278)
MaxymVlasov Nov 8, 2021
d4ae82f
Updated CHANGELOG
antonbabenko Nov 8, 2021
af10d4f
chore: Add deprecation notice to `terraform_docs_replace` (#280)
MaxymVlasov Nov 8, 2021
feabecc
fix: typo in arg name for terraform-docs (#283)
mj3c Nov 17, 2021
c5bcad4
Updated CHANGELOG
antonbabenko Nov 17, 2021
3b4be67
chore: Fix master merge to working branch on pre-commit autofixes (#286)
MaxymVlasov Nov 17, 2021
003cd1d
chore: Publish container image on release (#285)
MindTooth Nov 20, 2021
6a064b1
Updated CHANGELOG
antonbabenko Nov 20, 2021
4543f10
fix: Fixed docker build (#288)
sg70 Dec 6, 2021
31e7ccf
Updated CHANGELOG
antonbabenko Dec 6, 2021
01d262c
fix: pre-build docker image (#292)
MaxymVlasov Dec 8, 2021
141f815
Updated CHANGELOG
antonbabenko Dec 8, 2021
7c6ad7c
fix: analyse all folders with tflint and don't stop on first executio…
bmbferreira Dec 8, 2021
45575c3
feat: Pass custom arguments to terraform init in `terraform_validate`…
maxbrunet Dec 11, 2021
00a5ef0
Updated CHANGELOG
antonbabenko Dec 11, 2021
1bcca44
feat: Added semantic release (#296)
antonbabenko Dec 12, 2021
e1bccb7
chore(release): version 1.62.0 [skip ci]
semantic-release-bot Dec 12, 2021
8c063c7
chore: Validate PR title (#297)
antonbabenko Dec 12, 2021
b8f90bd
chore: Updated validation PR title types (#298)
antonbabenko Dec 12, 2021
21185f6
chore: Fixed allowed types for PR titles
antonbabenko Dec 13, 2021
59da4b8
chore: Publish container image only after the release
antonbabenko Dec 13, 2021
93029dc
fix(terraform_tflint): Restore current working directory behavior (#302)
maxbrunet Dec 18, 2021
77bd661
chore: Use valid token for the Release GHA
antonbabenko Dec 18, 2021
d826474
chore(release): version 1.62.1 [skip ci]
semantic-release-bot Dec 18, 2021
b431a43
fix: Properly exclude .terraform directory with checkov hook (#306)
MaxymVlasov Dec 21, 2021
2e8dcf9
fix: Speedup `terrascan` hook up to x3 times in big repos (#307)
MaxymVlasov Dec 21, 2021
0962458
chore: Release action should track hooks configuration changes (#308)
MaxymVlasov Dec 21, 2021
04ecd10
chore(release): version 1.62.2 [skip ci]
semantic-release-bot Dec 21, 2021
66401d9
fix: Check all directories with changes and pass all args in terrasca…
carlosbustillordguez Dec 22, 2021
ac9299c
chore(release): version 1.62.3 [skip ci]
semantic-release-bot Dec 22, 2021
1f16f09
chore: Refactor all hooks (#310)
MaxymVlasov Jan 6, 2022
645f3fd
chore: Cleanup file with test data (#311)
MaxymVlasov Jan 6, 2022
3045dd5
chore: Add shellcheck and make checks passing (#315)
MaxymVlasov Jan 6, 2022
c5f2a61
chore: Improved code structure (moved hooks into a separate dir) (#316)
MaxymVlasov Jan 6, 2022
661a0cf
chore: Specify what we exactly mean (#320)
MaxymVlasov Jan 11, 2022
321fb16
chore: Document functions (based on google style guide) (#317)
MaxymVlasov Jan 11, 2022
4722900
chore: Add hadolint check for Dockerfiles (#322)
MaxymVlasov Jan 11, 2022
71647bb
chore: Add Github Actions Workflow to build if Dockerfile updated (#318)
mohitsaxenaknoldus Jan 11, 2022
441e87a
docs: Add workaround for configuration_aliases tf bug (#332)
mbainter Feb 3, 2022
a80d383
chore: fix bug intoduced in #316 (#335)
MaxymVlasov Feb 10, 2022
7e7c916
feat: Improve performance during `pre-commit --all (-a)` run (#327)
carlosbustillordguez Feb 10, 2022
c266d40
chore(release): version 1.63.0 [skip ci]
semantic-release-bot Feb 10, 2022
579dc45
feat: Improved speed of `pre-commit run -a` for multiple hooks (#338)
MaxymVlasov Feb 10, 2022
c2d1a58
chore(release): version 1.64.0 [skip ci]
semantic-release-bot Feb 10, 2022
e88abb6
chore: Fix docker test workflow (#340)
MaxymVlasov Feb 10, 2022
458fb28
chore: Add Docker latest and nightly tag (#343)
pasqualedevita Feb 15, 2022
4aaef7e
Merge remote-tracking branch 'upstream/master' into rebase-to-upstream
mrwacky42 Feb 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.dockerignore
!Dockerfile
14 changes: 14 additions & 0 deletions .editorconfig
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @maxymvlasov @yermulnik
Copy link

@flimits flimits Feb 15, 2022

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?

142 changes: 142 additions & 0 deletions .github/CONTRIBUTING.md
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).
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [antonbabenko]
custom: https://www.paypal.me/antonbabenko
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_docker.md
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>
106 changes: 106 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_local_install.md
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>
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
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.
-->