Skip to content

Commit fbb4a87

Browse files
authored
Enforce no trailing whitespace (#4845)
## Changes This mirrors databricks/cli#2603. I ran into this when working on `jobs/resource_job_test.go`. My editor trims trailing whitespace on save and I got a dozen diffs related to this. Enforcing no trailing whitespace reduces this noise. ## Tests - `make ws` is run for PRs to ensure new code doesn't violate this - The VS Code settings are updated to trim trailing whitespace on save. <!-- NO_CHANGELOG=true //-->
1 parent 4e9ed68 commit fbb4a87

File tree

130 files changed

+507
-391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+507
-391
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
"make test"
1414
]
1515
}
16-
}
16+
}

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN \
1818
&& apt-get clean -y \
1919
&& rm -rf /var/lib/apt/lists/*
2020

21-
# Install terraform
21+
# Install terraform
2222
RUN \
2323
mkdir -p /tmp/docker-downloads \
2424
&& curl -sSL -o /tmp/docker-downloads/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip \
@@ -34,7 +34,7 @@ RUN \
3434
go install -v golang.org/x/tools/cmd/goimports@latest \
3535
# # --> Gotestsum
3636
&& go install -v gotest.tools/gotestsum@latest \
37-
# # --> Go symbols and outline for go to symbol support and test support
37+
# # --> Go symbols and outline for go to symbol support and test support
3838
&& go install github.com/acroca/[email protected] \
3939
# # --> Static checker
4040
&& go install honnef.co/go/tools/cmd/[email protected] \

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// Use host network
3232
"--network=host",
3333
],
34-
// Use 'settings' to set *default* container specific settings.json values on container create.
34+
// Use 'settings' to set *default* container specific settings.json values on container create.
3535
// You can edit these settings after create using File > Preferences > Settings > Remote.
3636
"settings": {
3737
"terminal.integrated.shell.linux": "/bin/bash",
@@ -50,7 +50,7 @@
5050
"completeUnimported": true, // autocomplete unimported packages
5151
"deepCompletion": true, // enable deep completion
5252
},
53-
"files.eol": "\n", // formatting only supports LF line endings
53+
"files.eol": "\n", // formatting only supports LF line endings
5454
},
5555
// Uncomment the next line if you want to publish any ports.
5656
// "appPort": [],

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ dist
44
examples
55
scripts/*-integration/.terraform
66
scripts/*-integration/*.log
7-
scripts/*-integration/*.out
7+
scripts/*-integration/*.out

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ARM_TENANT_ID=<active directory tenant id>
66
ARM_SUBSCRIPTION_ID=<subscription id in which the workspace is being built>
77
TEST_MANAGED_RESOURCE_GROUP=<managed resource group id for integration testing>
88
TEST_WORKSPACE_NAME=<workspace name for integration testing>
9-
TEST_RESOURCE_GROUP=<workspace resource group for integration testing>
9+
TEST_RESOURCE_GROUP=<workspace resource group for integration testing>

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ contact_links:
77
- name: General Terraform questions
88
url: https://www.terraform.io/community
99
about: Issues related to Terraform and not related to Databricks Terraform Provider.
10-
10+
1111
- name: General questions on Databricks Terraform provider
1212
url: https://stackoverflow.com/questions/tagged/terraform-provider-databricks
1313
about: Please create a new question on StackOverflow with tag `terraform-provider-databricks`.
14-

.github/ISSUE_TEMPLATE/provider-issue.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ title: "[ISSUE] Issue with `databricks_XXX` resource"
77
<!--
88
Hi there,
99
10-
Please make sure that you checked Troubleshooting Guide first:
10+
Please make sure that you checked Troubleshooting Guide first:
1111
https://registry.terraform.io/providers/databricks/databricks/latest/docs/guides/troubleshooting
1212
13-
Thank you for opening an issue.
14-
Please note that we try to keep the Databricks Provider issue tracker reserved for bug reports and feature requests.
13+
Thank you for opening an issue.
14+
Please note that we try to keep the Databricks Provider issue tracker reserved for bug reports and feature requests.
1515
For general Terraform usage questions, please see: <https://www.terraform.io/community.html>.
1616
Questions about Databricks Provider please post on https://community.databricks.com
1717
-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<!-- Summary of your changes that are easy to understand -->
33

44
## Tests
5-
<!--
6-
How is this tested? Please see the checklist below and also describe any other relevant tests
5+
<!--
6+
How is this tested? Please see the checklist below and also describe any other relevant tests
77
-->
88

99
- [ ] `make test` run locally

.github/workflows/next-changelog.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
run: |
2323
# Use the GitHub API to fetch changed files
2424
files=$(gh pr view ${{ github.event.pull_request.number }} --json files -q '.files[].path')
25-
25+
2626
# Sanitize to avoid code injection
2727
sanitized_files=$(echo "$files" | sed 's/[^a-zA-Z0-9._/-]/_/g')
28-
28+
2929
# Store the sanitized list of files in a temporary file to avoid env variable issues
3030
echo "$sanitized_files" > modified_files.txt
3131
@@ -36,10 +36,10 @@ jobs:
3636
run: |
3737
# Use the GitHub API to fetch the PR message
3838
pr_message=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body')
39-
39+
4040
# Sanitize the PR message to avoid code injection, keeping the equal sign
4141
sanitized_pr_message=$(echo "$pr_message" | sed 's/[^a-zA-Z0-9._/-=]/_/g')
42-
42+
4343
# Store the sanitized PR message
4444
echo "$sanitized_pr_message" > pr_message.txt
4545
@@ -48,12 +48,12 @@ jobs:
4848
# Read the sanitized files and PR message from the temporary files
4949
modified_files=$(cat modified_files.txt)
5050
pr_message=$(cat pr_message.txt)
51-
51+
5252
# Check if NEXT_CHANGELOG.md exists in the list of changed files
5353
echo "Changed files: $modified_files"
5454
if ! echo "$modified_files" | grep -q "NEXT_CHANGELOG.md"; then
5555
echo "NEXT_CHANGELOG.md not modified."
56-
56+
5757
# Check if PR message contains NO_CHANGELOG=true
5858
if echo "$pr_message" | grep -q "NO_CHANGELOG=true"; then
5959
echo "NO_CHANGELOG=true found in PR message. Skipping changelog check."
@@ -79,7 +79,7 @@ jobs:
7979
echo "Adding instructions comment."
8080
gh pr comment ${{ github.event.pull_request.number }} --body \
8181
"<!-- NEXT_CHANGELOG_INSTRUCTIONS -->
82-
Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
82+
Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
8383
If this is not necessary for your PR, please include the following in your PR description:
8484
NO_CHANGELOG=true
8585
and rerun the job."
@@ -93,7 +93,7 @@ jobs:
9393
# Check if there is a previous instructions comment
9494
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
9595
--jq '.[] | select(.body | startswith("<!-- NEXT_CHANGELOG_INSTRUCTIONS -->")) | .id')
96-
96+
9797
# If a comment exists, delete it
9898
if [ -n "$previous_comment_ids" ]; then
9999
echo "Deleting previous instructions comment."

.github/workflows/push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
# -w: write back formatted files to disk
5151
gofmt -l -w ./
5252
53+
- name: Run whitespace validation
54+
run: make ws
55+
5356
- name: Fail on differences
5457
run: |
5558
# Exit with status code 1 if there are differences (i.e. unformatted files)

0 commit comments

Comments
 (0)