Skip to content

CONTRIBUTING: Drop stale structure-check references #248

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ For contributors who want to work up pull requests, the workflow is roughly:
3. Make sure your commit messages are in the proper format (see [below](#commit-message-format)).
4. Push your changes to a topic branch in your fork of the repository.
5. Make sure the tests pass, and add any new tests as appropriate.
6. Please run this command before submitting your pull request:
6. We run a number of linters and tests on each pull request.
You may wish to run these locally before submitting your pull request:
```sh
make structure-check
hack/go-fmt.sh .
hack/go-lint.sh $(go list -f '{{ .ImportPath }}' ./...)
hack/go-vet.sh ./...
hack/shellcheck.sh
hack/test-bazel-build-tarball.sh
hack/tf-fmt.sh -list -check
hack/tf-lint.sh
hack/yaml-lint.sh
```
Note that a portion of the docs and examples are generated and that the generated files are to be committed by you. `make structure-check` checks that what is generated is what you must commit.
7. Submit a pull request to the original repository.
8. The [repo](OWNERS) [owners](OWNERS_ALIASES) will respond to your issue promptly, following [the ususal Prow workflow][prow-review].

Expand All @@ -52,9 +59,7 @@ Thanks for your contributions!

The coding style suggested by the Golang community is used in installer. See the [style doc][golang-style] for details. Please follow them when working on your contributions.

Tectonic Installer includes syntax checks on the Terraform templates which will fail the PR checker for non-standard formatted code.

Use `make structure-check` to identify files that don't meet the canonical format and style. Then, use `terraform fmt` to align the template syntax, if necessary.
Terraform has similar standards, and you can run `terraform fmt` to rewrite Terraform files to the canonical format.

## Commit Message Format

Expand Down
5 changes: 4 additions & 1 deletion hack/shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ if [ "$IS_CONTAINER" != "" ]; then
find "${TOP_DIR}" \
-path "${TOP_DIR}/vendor" -prune \
-o -path "${TOP_DIR}/.build" -prune \
-o -path "${TOP_DIR}/tests/smoke/vendor" -prune \
-o -path "${TOP_DIR}/tests/smoke/.build" -prune \
-o -type f -name '*.sh' -exec shellcheck --format=gcc {} \+
else
podman run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/workdir:ro,z" \
--entrypoint sh \
--workdir /workdir \
quay.io/coreos/shellcheck-alpine:v0.5.0 \
/workdir/hack/shellcheck.sh /workdir
/workdir/hack/shellcheck.sh "${@}"
fi;
7 changes: 5 additions & 2 deletions hack/tf-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

# in prow, already in container, so no 'podman run'
if [ "$IS_CONTAINER" != "" ]; then
if [ "${#N}" -gt 1 ]; then
set -- -list -check -write=false
fi
set -x
/terraform fmt -list -check -write=false
/terraform fmt "${@}"
else
podman run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:${PWD}:ro,z" \
--volume "${PWD}:${PWD}:z" \
--workdir "${PWD}" \
quay.io/coreos/terraform-alpine:v0.11.7 \
./hack/tf-fmt.sh
Expand Down