Skip to content

Commit

Permalink
Merge branch 'master' into add-terraform-providers-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov authored Oct 1, 2021
2 parents 14e7a10 + 3404eed commit 9ef1864
Show file tree
Hide file tree
Showing 17 changed files with 910 additions and 122 deletions.
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

[{*.{sh,py,md},Dockerfile}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
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.
-->
31 changes: 31 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
Thank you for helping to improve pre-commit-terraform!
-->

Put an `x` into the box if that apply:

- [ ] This PR introduces breaking change.
- [ ] This PR fixes a bug.
- [ ] This PR adds new functionality.
- [ ] This PR enhances existing functionality.

### Description of your changes

<!--
Briefly describe what this pull request does. Be sure to direct your reviewers'
attention to anything that needs special consideration.
We love pull requests that resolve an open pre-commit-terraform issue. If yours does, you
can uncomment the below line to indicate which issue your PR fixes, for example
"Fixes #123":
-->

<!-- Fixes # -->

### How has this code been tested

<!--
Before reviewers can be confident in the correctness of this pull request, it
needs to tested and shown to be correct. Briefly describe the testing that has
already been done or which is planned for this change.
-->
38 changes: 38 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Common issues check

on: [pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Get changed files
id: file_changes
run: |
export DIFF=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }})
echo "Diff between ${{ github.base_ref }} and ${{ github.sha }}"
echo "::set-output name=files::$( echo "$DIFF" | xargs echo )"
- name: Install shfmt
run: |
curl -L "$(curl -s https://api.github.com/repos/mvdan/sh/releases/latest | grep -o -E -m 1 "https://.+?linux_amd64")" > shfmt \
&& chmod +x shfmt && sudo mv shfmt /usr/bin/
# Need to success pre-commit fix push
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Execute pre-commit
uses: pre-commit/[email protected]
env:
SKIP: no-commit-to-branch
with:
token: ${{ secrets.GITHUB_TOKEN }}
extra_args: --color=always --show-diff-on-failure --files ${{ steps.file_changes.outputs.files }}
31 changes: 31 additions & 0 deletions .github/workflows/stale-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Mark or close stale issues and PRs"
on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Staling issues and PR's
days-before-stale: 30
stale-issue-label: stale
stale-pr-label: stale
stale-issue-message: |
This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days
stale-pr-message: |
This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days
# Not stale if have this labels
exempt-issue-labels: bug,wip,on-hold
exempt-pr-labels: bug,wip,on-hold
# Close issue operations
# Label will be automatically removed if the issues are no longer closed nor locked.
days-before-close: 10
delete-branch: true
close-issue-message: This issue was automatically closed because of stale in 10 days
close-pr-message: This PR was automatically closed because of stale in 10 days
26 changes: 23 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.0.1
hooks:
- id: check-yaml
# Git style
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: forbid-new-submodules
- id: no-commit-to-branch

# Common errors
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
args: [--markdown-linebreak-ext=md]
- id: check-yaml
- id: check-merge-conflict
- id: check-executables-have-shebangs

# Cross platform
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]

# Security
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key


- repo: git://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
Expand Down
Loading

0 comments on commit 9ef1864

Please sign in to comment.