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

build: TestProtoMarshal correctly avoids Marshal methods #18496

Merged
merged 1 commit into from
Sep 20, 2017
Merged

build: TestProtoMarshal correctly avoids Marshal methods #18496

merged 1 commit into from
Sep 20, 2017

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Sep 14, 2017

Also use git grep exclusions rather than filtering its results.

@tamird tamird requested review from benesch, tbg and a team September 14, 2017 19:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tamird tamird requested a review from dt September 15, 2017 16:44
@benesch
Copy link
Contributor

benesch commented Sep 18, 2017

This is on my radar! Just still catching up from vacation.

@tamird
Copy link
Contributor Author

tamird commented Sep 19, 2017

Rebased to fix a merge conflict.

@nvanbenschoten
Copy link
Member

:lgtm:

@CLAassistant where you at?


Reviewed 20 of 20 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


build/style_test.go, line 139 at r1 (raw file):

				re: `\bos\.(Getenv|LookupEnv)\(`,
				excludes: []string{
					":!acceptance",

Where does a layman find documentation on this :! exclusion syntax?


Comments from Reviewable

@tamird
Copy link
Contributor Author

tamird commented Sep 20, 2017 via email

Also use `git grep` exclusions rather than filtering its results.
@tamird
Copy link
Contributor Author

tamird commented Sep 20, 2017

Rebased to avoid skew; looks like acceptance hung, and my teamcity privileges have been revoked :(

Can someone rebuild for me?

@benesch
Copy link
Contributor

benesch commented Sep 20, 2017

Queued you a new build!


Review status: 19 of 20 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


build/style_test.go, line 139 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Where does a layman find documentation on this :! exclusion syntax?

https://git-scm.com/docs/gitglossary/2.13.1#gitglossary-aiddefpathspecapathspec

(Git pathspecs are super powerful.)


Comments from Reviewable

@tamird tamird merged commit cc2d642 into cockroachdb:master Sep 20, 2017
@tamird tamird deleted the better-lints branch September 20, 2017 12:30
Copy link
Contributor

@benesch benesch left a comment

Choose a reason for hiding this comment

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

(Sorry for the post-hoc review. If you don't mind responding to my comments with your thoughts I'm happy to pick off any changes myself.)

re: `\bos\.(Getenv|LookupEnv)\(`,
excludes: []string{
":!acceptance",
":!build/style_test.go",
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't in pkg, is it? Why would it get picked up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think git grep doesn't care about the directory you're in, or at least it doesn't when you specify '*.go'.

"*.go",
":!util/protoutil/marshal.go",
":!settings/settings_test.go",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This pattern really seems to deserve a grepExcluding(regexpattern, "file", "file2", ...) function, but this is an improvement as is so no need to hold up this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eh, I'm not sure I agree that there's much benefit to the indirection. Feel free to follow up if you feel strongly enough.

@@ -649,6 +727,9 @@ func TestStyle(t *testing.T) {
// TODO(tamird): replace this with errcheck.NewChecker() when
// https://github.com/dominikh/go-tools/issues/57 is fixed.
t.Run("TestErrCheck", func(t *testing.T) {
if testing.Short() {
t.Skip("short flag")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason you're sidecar-ing this bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this just got missed earlier; returncheck is roughly the same thing and it has this logic.

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.

4 participants