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

[linter] more optimal linter invocation for "all" case #2863

Merged
merged 4 commits into from
Nov 18, 2020
Merged
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
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ SUBDIR_TARGETS := \
genny-gen \
license-gen \
all-gen \
lint
all-gen

.PHONY: test-ci-unit
test-ci-unit: test-base
Expand Down Expand Up @@ -478,3 +478,8 @@ clean: clean-build
@rm -rf ./src/ctl/ui/build

.DEFAULT_GOAL := all

lint: install-tools linter
@echo "--- :golang: Running linter on 'src'"
./scripts/run-ci-lint.sh $(tools_bin_path)/golangci-lint ./src/...
./bin/linter ./src/...
Comment on lines +482 to +485
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a helper script for this? Can we just use golangci-lint config directly?

Also, can't recall - what is bin/linter and why do we need it on top of golangci-lint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to removing the script wrapper, seems redundant

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean this script https://github.com/m3db/m3/blob/master/scripts/run-ci-lint.sh ? can we?

it adds tag if ENV variable is present

TAGS=()
if [[ -n "$GO_BUILD_TAGS" ]]; then
  TAGS=("--build-tags" "${GO_BUILD_TAGS}")
fi

maybe I would do it as separate PR in that case. In case we break something and need to rollback.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to hardcode integration tag at least, so integration tests would be linted.
It does not look like this is in use right now, but should be cleaned up in a followup.