Skip to content

script/test: run 'go tool vet' during testing - #2788

Merged
ttaylorr merged 7 commits into
masterfrom
go-vet-in-tests
Dec 18, 2017
Merged

ttaylorr merged 7 commits into
masterfrom
go-vet-in-tests

Conversation

@ttaylorr

Copy link
Copy Markdown
Contributor

This pull request fixes go tool vet violations found in Git LFS, and runs go tool vet on the same list of packages being tested by any invocation of script/test.

@technoweenie's comment in #2743 (comment) got me thinking:

[ ... ]

In fact, what do you think of adding go vet to script/test? I doubt it passes now, but I'd like to start nudging lfs towards a standard go codebase.

I think that this is a good idea. go tool vet provides useful insight on code correctness, not style as opposed to golint. I think that correctness of this sort is useful information to know about while testing, so let's do both at the same time.

In doing so, this pull request comes in two parts:

  1. 7e4013d^1...a393bb1: fix current correctness violations found by go tool vet.
  2. 49de92b: refactor script/test to:
  • Accept relative package names or subdirectories (git, ./git respectively) as arguments.
  • Correctly run go tool vet over the same set of packages.

I think as a future point of discussion, adding golint (source) would be fruitful (as perhaps a part of script/lint, not script/test), but I believe that this discussion is out of the current scope.

/cc @git-lfs/core

@ttaylorr ttaylorr added this to the v2.4.0 milestone Dec 15, 2017
@ttaylorr
ttaylorr requested a review from rubyist December 15, 2017 02:13
@ttaylorr
ttaylorr merged commit aced46d into master Dec 18, 2017
@ttaylorr
ttaylorr deleted the go-vet-in-tests branch December 18, 2017 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants