Skip to content

Comments

Enable more of staticheck linter rules#3360

Merged
denik merged 5 commits intomainfrom
denik/more-staticcheck
Aug 5, 2025
Merged

Enable more of staticheck linter rules#3360
denik merged 5 commits intomainfrom
denik/more-staticcheck

Conversation

@denik
Copy link
Contributor

@denik denik commented Aug 5, 2025

Changes

Enable all rules except one (ST1003) which produces too many changes so deserves its own PR. Some had autofix, some were fixed with cursor.

Why

No reason to keep them disabled. I think they were disabled originally to minimize changes to original PR.

Tests

Existing tests.

@denik
Copy link
Contributor Author

denik commented Aug 5, 2025

For context, for receiver rule I asked cursor to pick the one with most existing cases. The linter reports this:

libs/dyn/path.go:17:24: ST1016: methods on the same type should have the same receiver name (seen 1x "component", 4x "c") (staticcheck)
func (c pathComponent) Index() int {
                       ^
libs/flags/progress_format.go:57:29: ST1016: methods on the same type should have the same receiver name (seen 1x "f", 3x "p") (staticcheck)
func (f *ProgressLogFormat) Complete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
                            ^
libs/jsonschema/schema.go:132:18: ST1016: methods on the same type should have the same receiver name (seen 14x "s", 9x "schema") (staticcheck)
func (s *Schema) DefaultString() (string, error) {

@denik denik temporarily deployed to test-trigger-is August 5, 2025 14:56 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Aug 5, 2025

Run: 16760475474

Env ✅‌pass 🔄‌flaky 🙈‌skip
✅‌ aws linux 309 460
✅‌ aws windows 310 459
🔄‌ aws-ucws linux 406 9 360
🔄‌ aws-ucws windows 406 10 359
✅‌ azure linux 309 459
✅‌ azure windows 310 458
🔄‌ azure-ucws linux 408 9 357
🔄‌ azure-ucws windows 414 4 356
✅‌ gcp linux 308 461
✅‌ gcp windows 309 460
11 failing tests:
Test Name aws-ucws linux aws-ucws windows azure-ucws linux azure-ucws windows
TestAccept ✅‌pass ✅‌pass ✅‌pass 🔄‌flaky
TestAccept/bundle/deploy/dashboard/detect-change 🔄‌flaky 🔄‌flaky 🔄‌flaky ✅‌pass
TestAccept/bundle/deploy/dashboard/generate_inplace 🔄‌flaky 🔄‌flaky 🔄‌flaky ✅‌pass
TestAccept/bundle/deploy/dashboard/nested-folders 🔄‌flaky 🔄‌flaky 🔄‌flaky ✅‌pass
TestAccept/bundle/deploy/dashboard/simple 🔄‌flaky 🔄‌flaky 🔄‌flaky ✅‌pass
TestAccept/bundle/deploy/dashboard/simple_outside_bundle_root 🔄‌flaky 🔄‌flaky 🔄‌flaky ✅‌pass
TestAccept/bundle/deploy/dashboard/simple_syncroot 🔄‌flaky 🔄‌flaky 🔄‌flaky ✅‌pass
TestAccept/bundle/deployment/bind/dashboard 🔄‌flaky 🔄‌flaky 🔄‌flaky 🔄‌flaky
TestAccept/bundle/deployment/bind/dashboard/recreation 🔄‌flaky 🔄‌flaky 🔄‌flaky 🔄‌flaky
TestDashboardAssumptions_WorkspaceImport 🔄‌flaky 🔄‌flaky 🔄‌flaky 🔄‌flaky
TestFetchRepositoryInfoAPI_FromRepo ✅‌pass 🔄‌flaky ✅‌pass ✅‌pass

@denik denik enabled auto-merge August 5, 2025 14:57
@denik denik temporarily deployed to test-trigger-is August 5, 2025 20:23 — with GitHub Actions Inactive
@denik denik added this pull request to the merge queue Aug 5, 2025
Merged via the queue into main with commit 745499c Aug 5, 2025
13 checks passed
@denik denik deleted the denik/more-staticcheck branch August 5, 2025 20:56
alyssa-db pushed a commit that referenced this pull request Aug 7, 2025
## Changes
Enable all rules except one (ST1003) which produces too many changes so
deserves its own PR. Some had autofix, some were fixed with cursor.

## Why
No reason to keep them disabled. I think they were disabled originally
to minimize changes to original PR.

## Tests
Existing tests.
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.

5 participants