chore: enable linting#95
Merged
Merged
Conversation
mbevc1
pushed a commit
that referenced
this pull request
Jun 11, 2026
Fixes the 65 issues reported by the lint job on PR #95 (linux), plus the issues that surface on the windows lint matrix leg: - revive exported: add doc comments to exported consts, vars, types, functions and methods across the 1Password backends, prompt.go, array.go, winhello and cmd/keyring. - revive unused-parameter: rename unused key params to _. - staticcheck ST1005: lowercase error strings (sentinel error message text changes, e.g. ErrKeyNotFound). - staticcheck SA1019: drop deprecated rand.Seed in keyctl_test.go. - noctx: use exec.CommandContext in pass.go, passage.go and tests. - prealloc: preallocate slices in array.go and test mocks. - thelper: add t.Helper() to test mock constructors and helpers. - errname: rename elementNotFoundError -> errElementNotFound (wincred). - rename tilde_test_linux.go -> tilde_linux_test.go: the old name does not end in _test.go, so these tests were compiled into the package but never run; they now execute (and pass). - .golangci.yaml: exclude nilnil in tests, where mocks intentionally return nil, nil. - SA1019: replace deprecated golang.org/x/crypto/ssh/terminal with golang.org/x/term (drops the x/crypto dependency entirely) - ineffassign: drop the unused passphrase assignment from setupTouchID, which unlocks the keychain itself; scope passphrase to the else branch - QF1008: use promoted md.Label instead of md.Item.Label
6a95b42 to
83a1cee
Compare
Fixes the 65 issues reported by the lint job on PR #95 (linux), plus the issues that surface on the windows lint matrix leg: - revive exported: add doc comments to exported consts, vars, types, functions and methods across the 1Password backends, prompt.go, array.go, winhello and cmd/keyring. - revive unused-parameter: rename unused key params to _. - staticcheck ST1005: lowercase error strings (sentinel error message text changes, e.g. ErrKeyNotFound). - staticcheck SA1019: drop deprecated rand.Seed in keyctl_test.go. - noctx: use exec.CommandContext in pass.go, passage.go and tests. - prealloc: preallocate slices in array.go and test mocks. - thelper: add t.Helper() to test mock constructors and helpers. - errname: rename elementNotFoundError -> errElementNotFound (wincred). - rename tilde_test_linux.go -> tilde_linux_test.go: the old name does not end in _test.go, so these tests were compiled into the package but never run; they now execute (and pass). - .golangci.yaml: exclude nilnil in tests, where mocks intentionally return nil, nil. - SA1019: replace deprecated golang.org/x/crypto/ssh/terminal with golang.org/x/term (drops the x/crypto dependency entirely) - ineffassign: drop the unused passphrase assignment from setupTouchID, which unlocks the keychain itself; scope passphrase to the else branch - QF1008: use promoted md.Label instead of md.Item.Label
83a1cee to
6634c33
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Consolidate and enable Go linting.
Fixes the 65 issues reported by the lint job on PR #95 (linux), plus the
issues that surface on the windows lint matrix leg:
functions and methods across the 1Password backends, prompt.go,
array.go, winhello and cmd/keyring.
text changes, e.g. ErrKeyNotFound).
not end in _test.go, so these tests were compiled into the package but
never run; they now execute (and pass).
return nil, nil.
golang.org/x/term (drops the x/crypto dependency entirely)
which unlocks the keychain itself; scope passphrase to the else branch