Skip to content

Conversation

@vertex451
Copy link
Contributor

@vertex451 vertex451 commented Jan 28, 2026

Description

Issues:

  • .golangci linter was badly formatted, some sections was ignored.
  • the --issues-exit-code=0 flag was used, which causes silent fails.
  • recommended linters were missing.

Changes

  • No logic changes
  • %w wraps errors instead of converting them to strings. This preserves the error chain for errors.Is() and errors.Unwrap().
  • Removed unused code

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Walkthrough

This PR standardizes error handling across multiple modules by replacing error formatting verbs from %v to %w for proper error wrapping, updates linting configuration with new linters and stricter rules, removes unused SDK type definitions and test utilities, and adds clarifying comments to error handling logic.

Changes

Cohort / File(s) Summary
Linting Configuration
.golangci.yaml, make/lint.mk
Enables new linters (bodyclose, cyclop, errorlint, nilerr, nilnil, noctx, revive) with expanded issue limits; adds cyclop complexity settings and revive rules; restructures exclusions with presets and rules. Lint target invocation simplified to use GOLANGCI_LINT tool directly; SUBLINTERS list removed.
Module Error Handling Standardization
x/{audit,cert,deployment,escrow,provider,take}/module.go
Replaces error formatting from %v to %w in ValidateGenesis across six module implementations, enabling proper error unwrapping while preserving message text.
General Error Wrapping Updates
cmd/akash/cmd/genaccounts.go, util/{cli,configs.go,server/server.go}, x/deployment/keeper/keeper.go
Systematically changes error formatting from %v to %w in error returns for Keybase operations, config validation, state export, and group key encoding.
Error Handling Documentation
upgrades/software/v1.1.0/upgrade.go, x/market/hooks/hooks.go
Adds explanatory comments documenting intentional error suppression in OnEscrowPaymentClosed; x/market version includes nolint:nilerr annotation for clarity.
Test & Type Cleanup
x/deployment/handler/handler_test.go, x/escrow/keeper/keeper_test.go, x/market/handler/handler_test.go, tests/upgrade/sdktypes.go
Removes test helper method createDeployment(), type declaration kTestSuite, and entire sdktypes.go file containing unused SDK-specific type definitions (nodeStatus, votingParams, depositParams, govParams, proposalResp, proposalsResp, SoftwareUpgradeProposal, ProposalMsg). Import alias adjustment in deployment handler test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Errors wrapped with %w instead of %v,
Now the stack traces flow more native,
Linters multiplied, rules refined with care,
Old test code and unused types—
Cleaned away without a thought to spare!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: linter issues' accurately summarizes the main change: fixing linter configuration and addressing linter issues throughout the codebase.
Description check ✅ Passed The PR description accurately describes the changes: reformatting .golangci configuration, enabling recommended linters, resolving issues, and standardizing error wrapping with %w. It directly relates to the changeset provided.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch artem/fix-linter-issues

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- unconvert
- unparam
- unused
settings:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

that part has wrong indentation

.PHONY: lint-go
lint-go: $(GOLANGCI_LINT)
$(GOLANGCI_LINT_RUN) ./... --issues-exit-code=0 --timeout=10m
$(GOLANGCI_LINT) run ./... --timeout=10m
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets fail in case of linter errors


info, err := kb.Key(args[0])
if err != nil {
return fmt.Errorf("failed to get address from Keybase: %v", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

%w wraps errors instead of converting them to strings. This preserves the error chain for errors.Is() and errors.Unwrap().

@vertex451 vertex451 self-assigned this Jan 28, 2026
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.

2 participants