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

Linting work to achieve a Go Report Card A+ #19

Merged
merged 35 commits into from
Sep 15, 2017
Merged

Linting work to achieve a Go Report Card A+ #19

merged 35 commits into from
Sep 15, 2017

Conversation

TerraTech
Copy link
Owner

Underlying tool was using gometalinter.

  mega linting pkg is extremely hard on the system shooting up
    loads and memory consumption, therefore it is best to split
    them up and drop the concurrency level on pkg when the crypto
    tests fire off.
  -cmd/gompw/flags.go:136::warning: declaration of "err" shadows declaration at cmd/gompw/flags.go:40 (vetshadow)
  -cmd/gompw/flags.go:139::warning: declaration of "err" shadows declaration at cmd/gompw/flags.go:40 (vetshadow)
  -cmd/gompw/flags.go:150::warning: declaration of "err" shadows declaration at cmd/gompw/flags.go:40 (vetshadow)
  -cmd/gompw/flags.go:160::warning: declaration of "err" shadows declaration at cmd/gompw/flags.go:40 (vetshadow)
  -cmd/gompw/flags.go:38::warning: cyclomatic complexity 32 of function handleFlags() is high (> 15) (gocyclo)
  -cmd/gompw/flags.go:84::warning: declaration of "err" shadows declaration at cmd/gompw/flags.go:40 (vetshadow)
  -cmd/gompw/flags.go:226:25:warning: parameter _default always receives 1 (unparam)
  -cmd/gompw/main.go:33:12:warning: should omit type string from declaration of var PROG; it will be inferred from the right-hand side (golint)
  -cmd/gompw/main.go:33:2:warning: exported var PROG should have comment or be unexported (golint)
  -cmd/gompw/main.go:35:12:warning: should omit type string from declaration of var BUILD; it will be inferred from the right-hand side (golint)
…the main pkg

  -cmd/gompw/main.go:43:6:warning: exported type MPW should have comment or be unexported (golint)
  -cmd/gompw/utils.go:34:2:warning: exported var D should have comment or be unexported (golint)
  -cmd/gompw/utils.go:34:2:warning: var D is unused (U1000) (megacheck)
  -cmd/gompw/utils.go:33:2:warning: don't use ALL_CAPS in Go names; use CamelCase (golint)
  -cmd/gompw/utils.go:33:2:warning: exported var MP_DEBUG should have comment or be unexported (golint)
  -cmd/gompw/utils.go:36:1:warning: exported function DEBUG should have comment or be unexported (golint)
  -cmd/gompw/utils.go:56:1:warning: readPassword is unused (deadcode)
  -cmd/gompw/utils.go:56:6:warning: func readPassword is unused (U1000) (megacheck)
… the system

  Also includes the 'pkg' cyclomatic adjustments
  -pkg/config/merge.go:28:6:warning: don't use underscores in Go names; type fields2Merge_t should be fields2MergeT (golint)
  -pkg/config/mpConfig.go:28:2:warning: exported const DefaultCounter should have comment (or a comment on this block) or be unexported (golint)
  -pkg/config/userConfigFile.go:35:2:warning: exported const DefaultConfigFilename should have comment (or a comment on this block) or be unexported (golint)
  -pkg/config/userConfigFile.go:34:1:warning: comment on exported function Gcfn should be of the form "Gcfn ..." (golint)
  -pkg/config/userConfigFile.go:67:1:warning: exported method MPConfig.LoadConfig should have comment or be unexported (golint)
  -pkg/crypto/masterPassword.go:106:14:warning: error return value not checked (binary.Write(&buffer, binary.BigEndian, uint32(len(mpw.fullname)))) (errcheck)
  -pkg/crypto/masterPassword.go:132:14:warning: error return value not checked (binary.Write(&buffer, binary.BigEndian, uint32(len(mpw.site)))) (errcheck)
  -pkg/crypto/masterPassword.go:134:14:warning: error return value not checked (binary.Write(&buffer, binary.BigEndian, mpw.counter)) (errcheck)
  -pkg/crypto/masterPassword.go:139:13:warning: error return value not checked (hmacv.Write(buffer.Bytes())) (errcheck)
  -pkg/crypto/masterPassword.go:179:24:warning: error return value not checked (mpw.SetPasswordPurpose(passwordPurpose)) (errcheck)
  -pkg/crypto/masterPassword.go:41:1:warning: comment on exported const DefaultMasterPasswordSeed should be of the form "DefaultMasterPasswordSeed ..." (golint)
  -pkg/crypto/masterPassword.go:46:2:warning: exported var Dbg should have comment or be unexported (golint)
  -pkg/crypto/masterPassword_test.go:117::warning: duplicate of pkg/crypto/masterPassword_test.go:128-138 (dupl)
  -pkg/crypto/masterPassword_test.go:128::warning: duplicate of pkg/crypto/masterPassword_test.go:139-149 (dupl)
  -pkg/crypto/masterPassword_test.go:139::warning: duplicate of pkg/crypto/masterPassword_test.go:174-184 (dupl)
  -pkg/crypto/masterPassword_test.go:174::warning: duplicate of pkg/crypto/masterPassword_test.go:117-127 (dupl)
  -pkg/crypto/merge.go:38:25:warning: error return value not checked (mpw.SetPasswordPurpose(c.PasswordPurpose)) (errcheck)
  -pkg/crypto/passwordPurpose.go:101:1:warning: receiver name pp should be consistent with previous receiver name p for PasswordPurpose (golint)
  -pkg/crypto/passwordPurpose.go:29:7:warning: exported const DefaultPasswordPurpose should have comment or be unexported (golint)
  -pkg/crypto/passwordPurpose.go:32:2:warning: exported const PasswordPurposeUnSet should have comment (or a comment on this block) or be unexported (golint)
  -pkg/crypto/passwordPurpose.go:39:2:warning: exported var ErrPasswordPurposeEmpty should have comment or be unexported (golint)
  -pkg/crypto/passwordPurpose.go:85:1:warning: comment on exported method MasterPW.SetPasswordPurpose should be of the form "SetPasswordPurpose ..." (golint)
  -pkg/crypto/passwordTypeTemplates.go:1::warning: file is not gofmted with -s (gofmt)
  -pkg/crypto/passwordTypeTemplates.go:80:9:warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
  -pkg/crypto/setters.go:67:1:warning: comment on exported method MasterPW.SetSite should be of the form "SetSite ..." (golint)
  -pkg/crypto/utils.go:29:6:warning: func mpwIdBuf should be mpwIDBuf (golint)
  -pkg/crypto/validate.go:28:2:warning: exported var ErrCounter should have comment or be unexported (golint)
  -pkg/debug/debug.go:36:2:warning: exported var D should have comment or be unexported (golint)
  -pkg/debug/debug.go:37:2:warning: don't use ALL_CAPS in Go names; use CamelCase (golint)
  -pkg/debug/debug.go:40:6:warning: exported type Debug should have comment or be unexported (golint)
  -pkg/debug/debug.go:33:6:warning: exported type Debug should have comment or be unexported (golint)
  -pkg/debug/debug.go:47:1:warning: exported function NewDebug should have comment or be unexported (golint)
  -pkg/debug/debug.go:58:1:warning: exported method Debug.Dbg should have comment or be unexported (golint)
  -pkg/debug/debug.go:75:1:warning: exported method Debug.DbgO should have comment or be unexported (golint)
  -pkg/debug/debug.go:79:1:warning: exported method Debug.SetFilename should have comment or be unexported (golint)
  -pkg/debug/debug.go:83:1:warning: exported method Debug.SetFilename should have comment or be unexported (golint)
@TerraTech TerraTech changed the title Linting work to achieve a goreport A+ Linting work to achieve a Go Report Card A+ Sep 15, 2017
@TerraTech TerraTech merged commit 5ed96e6 into master Sep 15, 2017
@TerraTech TerraTech deleted the ft/lint branch September 15, 2017 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant