-
-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore actual functions in FunctionOnlyReturningConstant (#3388) #3390
Ignore actual functions in FunctionOnlyReturningConstant (#3388) #3390
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3390 +/- ##
============================================
- Coverage 80.46% 80.40% -0.06%
- Complexity 2739 2745 +6
============================================
Files 448 448
Lines 8282 8279 -3
Branches 1573 1582 +9
============================================
- Hits 6664 6657 -7
+ Misses 771 767 -4
- Partials 847 855 +8 Continue to review full report at Codecov.
|
@@ -6,7 +6,7 @@ on: | |||
- master | |||
pull_request: | |||
branches: | |||
- '*' | |||
- '**' |
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.
Thank you for fixing the glob pattern in github workflows.
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.
Happy to help. The difference between *
and **
is well hidden in GitHub Actions documentation. Took me some time to figure out the first time.
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.
I learned Filter Pattern Cheat Sheet by reviewing this PR 🙏
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.
Thanks!
Closes #3388
Expected Behavior of the rule
By default,
actual
functions in multiplatform projects should be ignored when evaluatingFunctionOnlyReturningConstant
.There should be a configuration option
ignoreActualFunction
, which would allow changing this behaviour.Example
commonMain
jvmMain
jsMain
Context
Similar to
ignoreOverridableFunction
.Implementing an
actual
function, is conceptually similar to overriding a function from an interface/abstract class.It makes sense for such a function to provide complex logic on some platforms, and only return a constant value on others.