Skip to content
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

Enforce formatting on pull requests #2099

Merged
merged 3 commits into from
Mar 10, 2023
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
26 changes: 26 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,29 @@ jobs:

- name: Publish test coverage
uses: codecov/codecov-action@v1

fmt:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x

# No need to download cached dependencies when running gofmt.
cache: false

- name: Run gofmt
run: |
# -l: list files that were reformatted
# -w: write back formatted files to disk
gofmt -l -w ./

- name: Fail on differences
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code
1 change: 0 additions & 1 deletion aws/resource_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,3 @@ func TestResourceInstanceProfileUpdate_Error(t *testing.T) {
qa.AssertErrorStartsWith(t, err, "Internal error happened")
assert.Equal(t, "arn:aws:iam::999999999999:instance-profile/my-fake-instance-profile", d.Id())
}

10 changes: 5 additions & 5 deletions sql/api/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (

// Query ...
type Query struct {
ID string `json:"id,omitempty"`
DataSourceID string `json:"data_source_id"`
Name string `json:"name"`
Description string `json:"description"`
Query string `json:"query"`
ID string `json:"id,omitempty"`
DataSourceID string `json:"data_source_id"`
Name string `json:"name"`
Description string `json:"description"`
Query string `json:"query"`
// Deprecated: Use databricks_job resource to schedule a Query
Schedule *QuerySchedule `json:"schedule"`
Options *QueryOptions `json:"options,omitempty"`
Expand Down
18 changes: 9 additions & 9 deletions sql/resource_sql_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import (

// QueryEntity defines the parameters that can be set in the resource.
type QueryEntity struct {
DataSourceID string `json:"data_source_id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Query string `json:"query"`
DataSourceID string `json:"data_source_id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Query string `json:"query"`
// Deprecated: Use databricks_job resource to schedule a Query
Schedule *QuerySchedule `json:"schedule,omitempty"`
Tags []string `json:"tags,omitempty"`
Parameter []QueryParameter `json:"parameter,omitempty"`
RunAsRole string `json:"run_as_role,omitempty"`
Parent string `json:"parent,omitempty" tf:"suppress_diff,force_new"`
Schedule *QuerySchedule `json:"schedule,omitempty"`
Tags []string `json:"tags,omitempty"`
Parameter []QueryParameter `json:"parameter,omitempty"`
RunAsRole string `json:"run_as_role,omitempty"`
Parent string `json:"parent,omitempty" tf:"suppress_diff,force_new"`
}

// QuerySchedule ...
Expand Down