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

Add new CI step for lint validation #4903

Merged
merged 6 commits into from
Jul 18, 2022
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
14 changes: 14 additions & 0 deletions .buildkite/pipeline-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ steps:
run: unit-test
config: docker/buildkite/docker-compose.yml

- label: ":golangci-lint: validate code is clean"
agents:
queue: "workers"
docker: "*"
command: "./scripts/buildkite/golint.sh"
artifact_paths: []
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: unit-test
config: docker/buildkite/docker-compose.yml
davidporter-id-au marked this conversation as resolved.
Show resolved Hide resolved

- label: ":golang: integration test with cassandra"
agents:
queue: "workers"
Expand Down
14 changes: 14 additions & 0 deletions .buildkite/pipeline-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ steps:
run: unit-test
config: docker/buildkite/docker-compose.yml

- label: ":golangci-lint: validate code is clean"
agents:
queue: "workers"
docker: "*"
command: "./scripts/buildkite/golint.sh"
artifact_paths: []
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: unit-test
config: docker/buildkite/docker-compose.yml

- label: ":golang: integration test with cassandra"
agents:
queue: "workers"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ lint: ## (re)run the linter
fmt: $(BUILD)/fmt ## run goimports

# not identical to the intermediate target, but does provide the same codegen (or more).
copyright: $(BIN)/copyright ## update copyright headers
copyright: $(BIN)/copyright | $(BUILD) ## update copyright headers
$(BIN)/copyright
$Q touch $(BUILD)/copyright

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions common/reconciliation/invariant/collection_enumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ build:
lint: # Uber style rules: https://docs.buf.build/migration-prototool/#uber1-uber2
use:
- DEFAULT
ignore_only:
FIELD_LOWER_SNAKE_CASE:
- uber/cadence/history/v1/service.proto
- uber/cadence/matching/v1/service.proto
enum_zero_value_suffix: _INVALID
service_suffix: API
12 changes: 12 additions & 0 deletions scripts/buildkite/golint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -ex

make go-generate && make fmt && make lint && make copyright

if [ -n "$(git status --porcelain)" ]; then
echo "There are changes after make go-generate && make fmt && make lint && make copyright"
echo "Please rerun the command and commit the changes"
git status --porcelain
exit 1
fi
4 changes: 2 additions & 2 deletions service/worker/scanner/executions/scantype_enumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.