lints: better test utils, avoid accessing lint.Lints directly #364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up from #337 addressing the use of
lint.Lints
throughout the unit tests. This in turn will unblock switchinglint.Lints
to be unexported which will give the project more freedom to restructure for #344.At a high level:
testlint/testDef
directory. I'm not sure what it was used for historically but it appears unused today.testlint/testCerts
directory into justtestdata/
at the root of the project. All of the test files are certs and I think this is a little bit cleaner.util/testTools.go
to a dedicatedtest
package. That makes it clearer that only unit tests should be consuming things from that package vsutil
which is used by lint logic.test.TestLint
function that is used by the vast majority of the unit tests to load a cert from the test dir and execute a lint with a given name. Presently this function uses thelint.Lints
map directly but now we have 1 place to update when that field is no longer exported instead of 200+.This is a big diff, but it should be a functional no-op (only unit tests and test data are changed).