Skip to content

[Fix] - Linting and Code Quality Improvements#31

Merged
mrz1836 merged 3 commits into
masterfrom
feat/linter-fix
Dec 4, 2025
Merged

[Fix] - Linting and Code Quality Improvements#31
mrz1836 merged 3 commits into
masterfrom
feat/linter-fix

Conversation

@mrz1836
Copy link
Copy Markdown
Contributor

@mrz1836 mrz1836 commented Dec 3, 2025

This pull request primarily adds nolint comments to suppress linter warnings about code complexity and nested conditionals in several controller and utility functions. These comments clarify that the complexity is intentional due to the need for handling multiple override cases and selective field merging. Additionally, there are minor variable renaming improvements for error handling in status update logic.

Linting and Code Quality Improvements:

  • Added //nolint:gocognit,gocyclo comments to multiple update* methods in cluster controller files (cluster_asset.go, cluster_propagation.go, cluster_rpc.go, cluster_subtreevalidator.go) to suppress linter warnings about cognitive and cyclomatic complexity, acknowledging that the complexity is inherent to handling multiple override cases. [1] [2] [3] [4]
  • Added //nolint:nestif comments to selective field merging blocks in the same controller files, indicating that nested conditionals are required for the intended selective merging logic. [1] [2] [3]
  • Added similar nolint comments to utility functions in cluster_helpers.go and deployment.go for override merging logic. [1] [2] [3]

Minor Error Handling Improvements:

  • Renamed error variables from err to getErr in status update blocks for reconciler functions in asset_controller.go, propagation_controller.go, and subtreevalidator_controller.go to improve clarity and avoid shadowing. [1] [2] [3]

Updated error variable names for clarity in asset and propagation reconciler methods.
@mrz1836 mrz1836 requested a review from galt-tr December 3, 2025 20:52
@github-actions github-actions Bot added size/S Small change (11–50 lines) bug-P3 Lowest rated bug, affects nearly none or low-impact feature Any new significant addition labels Dec 3, 2025
@mrz1836 mrz1836 changed the title [Fix] - Linter Issues [Fix] - Linting and Code Quality Improvements Dec 3, 2025
@mrz1836 mrz1836 marked this pull request as ready for review December 3, 2025 20:52
@mrz1836 mrz1836 enabled auto-merge (squash) December 3, 2025 21:05
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 4, 2025

@mrz1836 mrz1836 merged commit 492818e into master Dec 4, 2025
42 checks passed
@github-actions github-actions Bot deleted the feat/linter-fix branch December 4, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-P3 Lowest rated bug, affects nearly none or low-impact feature Any new significant addition size/S Small change (11–50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants