Skip to content

Commit ac42c51

Browse files
authored
Apply suggestions from code review
1 parent 449d448 commit ac42c51

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

.github/CONTRIBUTING.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Enjoy the clean, valid, and documented code!
1818
* [Prepare basic documentation](#prepare-basic-documentation)
1919
* [Add code](#add-code)
2020
* [Finish with the documentation](#finish-with-the-documentation)
21-
* [Testing](#testing)
21+
* [Testing](#testing-python-hooks)
2222

2323
## Run and debug hooks locally
2424

@@ -157,10 +157,25 @@ You can use [this PR](https://github.com/antonbabenko/pre-commit-terraform/pull/
157157
2. Create and populate a new hook section in [Hooks usage notes and examples](../README.md#hooks-usage-notes-and-examples).
158158
159159
160-
## Testing
160+
## Testing python hooks
161161
162-
```
162+
Tu run tests, you need:
163+
164+
```bash
163165
pip install pytest pytest-mock
164166

165167
pytest -vv
166168
```
169+
170+
To run and debug hooks as CLI:
171+
172+
1. Create [`venv`](https://docs.python.org/3/library/venv.html) and activate it, IE by `virtualenv venv`
173+
2. Inside virtual env install pre-commit-terraform as package:
174+
```bash
175+
pip install --editable .
176+
```
177+
178+
3. Run next to show basic help:
179+
```bash
180+
python -Im pre_commit_terraform --help
181+
```

.pre-commit-hooks.yaml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@
1515
files: (\.tf|\.tfvars)$
1616
exclude: \.terraform/.*$
1717

18-
- id: terraform_fmt_py
19-
name: Terraform fmt
20-
description: Rewrites all Terraform configuration files to a canonical format.
21-
require_serial: true
22-
entry: python -Im pre_commit_terraform terraform_fmt_py
23-
language: python
24-
files: \.tf(vars)?$
25-
exclude: \.terraform/.*$
26-
2718
- id: terraform_docs
2819
name: Terraform docs
2920
description: Inserts input and output documentation into README.md (using terraform-docs).
@@ -147,16 +138,6 @@
147138
exclude: \.terraform/.*$
148139
require_serial: true
149140

150-
- id: terraform_checkov_py
151-
name: Checkov
152-
description: Runs checkov on Terraform templates.
153-
entry: python -Im pre_commit_terraform terraform_checkov_py
154-
language: python
155-
always_run: false
156-
files: \.tf$
157-
exclude: \.terraform/.*$
158-
require_serial: true
159-
160141
- id: terraform_wrapper_module_for_each
161142
name: Terraform wrapper with for_each in module
162143
description: Generate Terraform wrappers with for_each in module.

0 commit comments

Comments
 (0)