Skip to content

fix(lint): resolve 22+ Go linter errors across codebase#17

Merged
flexiondotorg merged 3 commits intomainfrom
ci
Mar 17, 2026
Merged

fix(lint): resolve 22+ Go linter errors across codebase#17
flexiondotorg merged 3 commits intomainfrom
ci

Conversation

@flexiondotorg
Copy link
Contributor

Summary

Resolves Go linter errors and enforces consistent code quality standards across the codebase. Adds comprehensive golangci-lint configuration to catch issues during development.

Changes

  • Fixed 22+ Go linter errors across the codebase
  • Added .golangci.yml configuration for consistent linting
  • Updated .gitignore to exclude linter cache
  • Fixed naming violations, unused variables, and other lint issues in:
    • cmd/jivedrop/main.go and tests
    • internal/cli/help.go
    • internal/encoder (encoder.go, metadata.go, and tests)
    • internal/id3 (artwork.go, artwork_test.go, writer_test.go)
    • internal/ui/views.go
  • Updated GitHub Actions workflow configuration
  • Added justfile recipes for linting commands

Testing

  • All tests pass with no linter errors
  • golangci-lint validates against the new configuration
  • CI/CD workflows verify clean lint status

…er workflow

- Replace separate build.yml and release.yml with unified builder.yml
- Add actionlint problem matcher for GitHub Actions validation
- Add golangci.yml configuration for code linting
- Update direnv and Nix development shell configuration

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Fix whitespace, function naming, and type assertion errors in
  cmd/jivedrop
- Correct unused variable and parameter issues in internal/encoder
- Resolve linter issues in internal/id3 and internal/ui
- Update .golangci.yml to enable modernize linter
- Scope .gitignore jivedrop entry to repository root only

Signed-off-by: Martin Wimpress <code@wimpress.io>
@github-advanced-security
Copy link

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 22 files

Confidence score: 4/5

  • This PR looks safe to merge overall: the reported issues are mostly CI/test hardening and lint reliability concerns rather than clear runtime breakage in production code.
  • The highest-risk item is in .github/workflows/builder.yml: using golang/govulncheck-action@master is mutable and can introduce unexpected or unreviewed behavior in the pipeline, so pinning to a release or SHA would reduce supply-chain and reproducibility risk.
  • Tooling drift issues (@latest in .github/workflows/builder.yml, ANSI matcher limitations in .github/actionlint-matcher.json, and missing gocyclo -over in justfile) can cause inconsistent checks or allow complexity regressions to slip through.
  • Pay close attention to .github/workflows/builder.yml, .github/actionlint-matcher.json, justfile, and cmd/jivedrop/main_test.go - they affect CI determinism, annotation accuracy, lint enforcement, and path-validation correctness in tests.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="cmd/jivedrop/main_test.go">

<violation number="1" location="cmd/jivedrop/main_test.go:499">
P2: Use a path-aware containment check here. `strings.HasPrefix` also matches sibling directories with the same textual prefix, so this test can miss incorrect output paths.</violation>
</file>

<file name=".github/actionlint-matcher.json">

<violation number="1" location=".github/actionlint-matcher.json:7">
P2: Broaden the ANSI escape pattern here; `\x1b\[\d+m` misses standard multi-parameter SGR sequences, so colorised actionlint output can stop producing annotations.</violation>
</file>

<file name=".github/workflows/builder.yml">

<violation number="1" location=".github/workflows/builder.yml:35">
P2: Pin the CI-installed linter versions instead of using `@latest`, otherwise lint results can change underneath the repo.</violation>

<violation number="2" location=".github/workflows/builder.yml:132">
P1: Pin `golang/govulncheck-action` to a released version or commit SHA instead of the mutable `master` branch.</violation>
</file>

<file name="justfile">

<violation number="1" location="justfile:120">
P2: Add an `-over` threshold here; with only `-top` and `-avg`, `gocyclo` reports complexity but never fails the lint target on regressions.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

…alse positives

Replace strings.HasPrefix check with filepath.Rel validation to ensure
test properly detects when a path is actually contained within the
target directory, preventing false positives when sibling directories
share a textual prefix.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: This PR includes significant changes to CI/CD workflows (replacing build/release YAMLs) and wide-scale linter-driven refactors which require human oversight.

@flexiondotorg flexiondotorg merged commit a604e43 into main Mar 17, 2026
18 checks passed
@flexiondotorg flexiondotorg deleted the ci branch March 17, 2026 13:56
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