Skip to content

chore: enable linting#95

Merged
mbevc1 merged 2 commits into
mainfrom
20260611_enable_lint
Jun 11, 2026
Merged

chore: enable linting#95
mbevc1 merged 2 commits into
mainfrom
20260611_enable_lint

Conversation

@mbevc1

@mbevc1 mbevc1 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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:

  • 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

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
@mbevc1 mbevc1 force-pushed the 20260611_enable_lint branch from 6a95b42 to 83a1cee Compare June 11, 2026 22:20
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
@mbevc1 mbevc1 force-pushed the 20260611_enable_lint branch from 83a1cee to 6634c33 Compare June 11, 2026 22:20
@mbevc1 mbevc1 merged commit 9b00daf into main Jun 11, 2026
14 checks passed
@mbevc1 mbevc1 deleted the 20260611_enable_lint branch June 11, 2026 22:28
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.

1 participant