Without this patch there are a number of annoyances with the make
checks. This patch fixes the following:
Newlines not being added to auto-generated documentation.
Auto generated documentation failing if README.md does not exist.
Checks execute against .git/ index
terraform validate executes redundantly
To address the doc generation annoyances, this patch converts
combine_docfiles to fairly simple bash. The behavior is pure sed, the
rest of the bash is argument and error handling.
For the others, the patch refactors make.sh to use a general find |
xargs pattern with a single function to manage exclusion lists.
check_shebangs is removed because #! /bin/bash -e should not be used
because it does not take effect if the script is called via bash
. Instead, calling `set -e` is preferred.
## Expected results:
```
make
Running shellcheck
Running flake8
Running go fmt and go vet
Running terraform validate
Running hadolint on Dockerfiles
Checking for required files LICENSE README.md
Testing the validity of the header check
..
----------------------------------------------------------------------
Ran 2 tests in 0.057s
OK
Checking file headers
The following lines have trailing whitespace
Generating markdown docs with terraform-docs
No changes made: ./README.md
No changes made: ./examples/simple_example/README.md
```
Without this patch there are a number of annoyances with the make checks. This patch fixes the following:
To address the doc generation annoyances, this patch converts combine_docfiles to fairly simple bash. The behavior is pure sed, the rest of the bash is argument and error handling.
For the others, the patch refactors make.sh to use a general find | xargs pattern with a single function to manage exclusion lists.
check_shebangs is removed because
#! /bin/bash -e
should not be used because it does not take effect if the script is called via bash