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

lint: don't use -unused.whole-program when PKG is specified #62443

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

stevendanna
Copy link
Collaborator

The unused linter's whole program mode will create false-positives
when PKG is specified. As a result, anyone trying to use

make lint PKG=./pkg/SOMETHING

has to carefully read the failure output to see if it was actually a
success. By not passing that flag when PKG is specified, more cases of
the above command complete without erroneous findings.

Release note: None

The unused linter's whole program mode will create false-positives
when PKG is specified. As a result, anyone trying to use

    make lint PKG=./pkg/SOMETHING

has to carefully read the failure output to see if it was actually a
success. By not passing that flag when PKG is specified, more cases of
the above command complete without erroneous findings.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@stevendanna stevendanna requested review from a team, shermanCRL and HonoreDB and removed request for a team and shermanCRL March 23, 2021 13:26
@HonoreDB
Copy link
Contributor


pkg/testutils/lint/lint_test.go, line 1615 at r1 (raw file):

			args = []string{pkgScope}
		} else {
			args = []string{"-unused.whole-program", pkgScope}

Isn't pkgScope empty in this case anyway?

@stevendanna
Copy link
Collaborator Author

Isn't pkgScope empty in this case anyway?

I don't think so:

// Things that are packaged scoped are below here.
pkgScope := pkgVar
if !pkgSpecified {
pkgScope = "./pkg/..."
}

Copy link
Contributor

@HonoreDB HonoreDB left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @stevendanna)

@stevendanna
Copy link
Collaborator Author

bors=HonoreDB

@stevendanna
Copy link
Collaborator Author

bors r=HonoreDB

@craig
Copy link
Contributor

craig bot commented Mar 23, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 23, 2021

Build succeeded:

@craig craig bot merged commit 35a64c6 into cockroachdb:master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants