-
Notifications
You must be signed in to change notification settings - Fork 267
feat: add static code diagnostic arguments-ordering #1047
feat: add static code diagnostic arguments-ordering #1047
Conversation
Kudos, SonarCloud Quality Gate passed! |
Codecov Report
@@ Coverage Diff @@
## master #1047 +/- ##
==========================================
+ Coverage 84.74% 84.86% +0.11%
==========================================
Files 327 330 +3
Lines 7196 7253 +57
==========================================
+ Hits 6098 6155 +57
Misses 1098 1098
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I finally finished this PR :) This rule might be a bit hard to adopt for large code bases without CLI "auto-fix". However, I managed to test this rule on our relatively large code base and spent just about half a hour to fix all ~250 issues in VSCode by just monkey clicking "Fix" light bulb in problems panel:) I didn't found any issues with this rule on our code base, auto fix also worked pretty well. So I assume this implementation should be quite ready to ship. @dkrutskikh , @incendial - could you please take a look? I've got a strange issue with automated checks for this PR and don't have any idea how it can be fixed: |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 🔥
But I bet someone might want to have a specific order 😁
Sure 😁 But it will be quite easy to implement new sorting options having "core" rule part completed. |
arguments-ordering
ruleEnforces named argument order in function and constructor invocations to be the same as corresponding named parameter declaration order.
The rule can be used together with sort_child_properties_last rule by setting
child-last: true
in rule configuration.⚙️ Config example
Example
❌ Bad:
✅ Good: