https://github.com/anmolnagpal/git-hooks-terraform
pre-commit git hooks to take care of Terraform configurations
https://github.com/anmolnagpal/git-hooks-terraform
clouddrove git githook github hooks terraform
Last synced: 3 months ago
JSON representation
pre-commit git hooks to take care of Terraform configurations
- Host: GitHub
- URL: https://github.com/anmolnagpal/git-hooks-terraform
- Owner: anmolnagpal
- License: mit
- Created: 2019-03-29T12:12:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T12:55:16.000Z (about 6 years ago)
- Last Synced: 2025-01-12T07:12:19.736Z (5 months ago)
- Topics: clouddrove, git, githook, github, hooks, terraform
- Language: Shell
- Homepage: https://pre-commit.com
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Git Hooks for terraformpre-commit hooks to keep Terraform configurations in a good shape ;)
## Hooks available
* `fmt` - Rewrites all Terraform configuration files to a canonical format.
* `validate` - Validates all Terraform configuration files.Enjoy the clean and documented code!
### 🔰Getting Started
> Follow the steps below to get started#### 🔨 Setting Up pre-commit
> install the pre-commit package- Using pip:
```bash
pip install pre-commit
```
- Using homebrew:
```bash
brew install pre-commit
```
Step into the repository you want to have the pre-commit hooks installed and run:
```yaml
cat < .pre-commit-config.yaml
- repo: git://github.com/anmolnagpal/git-hooks-terraform
rev: v1.0.0 # Use the ref you want to point at
hooks:
- id: fmt
- id: validate
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0 # Use the ref you want to point at
hooks:
- id: check-merge-conflict
EOF
```
Install the pre-commit hook
```
pre-commit install
```
After pre-commit hook has been installed you can run it manually on all files in the repository
```
pre-commit run -a
```## 📚Refrence
- https://github.com/pre-commit/pre-commit-hooks## 👬 Contribution
- Open pull request with improvements
- Discuss ideas in issues
- Reach out with any feedback [](https://twitter.com/anmol_nagpal)