Skip to content

Conversation

@mwbrooks
Copy link
Member

@mwbrooks mwbrooks commented May 5, 2025

Summary

This pull request enables the linter staticcheck rule ST1008: 'A function’s error value should be its last return value'.

func HelloWorld (string, error)
func HelloWorld (error, string)

Requirements

@mwbrooks mwbrooks added this to the Next Release milestone May 5, 2025
@mwbrooks mwbrooks self-assigned this May 5, 2025
@mwbrooks mwbrooks requested a review from a team as a code owner May 5, 2025 16:53
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels May 5, 2025
@codecov
Copy link

codecov bot commented May 5, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.16%. Comparing base (f21cbc2) to head (79dd545).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/root.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
- Coverage   63.16%   63.16%   -0.01%     
==========================================
  Files         210      210              
  Lines       22187    22187              
==========================================
- Hits        14015    14014       -1     
- Misses       7083     7086       +3     
+ Partials     1089     1087       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@mwbrooks I like this rule so much! 🤖 ✨

Before merging we might want to change one more instance of erroneous error returns:

func (s *SDKCLIConfig) Exists() (error, bool) {

I'm not sure how the linter missed this, but it's been bugging me for a while 😉

@mwbrooks
Copy link
Member Author

mwbrooks commented May 5, 2025

Good catch @zimeg! 🎉 It's strange that the linter didn't find that one.

Commit c5a8bbd updates func (s *SDKCLIConfig) Exists() (bool, error) {

@mwbrooks mwbrooks merged commit 9437aa2 into main May 5, 2025
6 checks passed
@mwbrooks mwbrooks deleted the mwbrooks-lint-st1008 branch May 5, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants