-
Notifications
You must be signed in to change notification settings - Fork 232
Konsist #1526
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
Konsist #1526
Conversation
… and fix existing issue
…ix existing issues
…med 'createPresenterName', and fix existing issues
Error Error
Dangerfile
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Kudos, SonarCloud Quality Gate passed! |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #1526 +/- ##
===========================================
+ Coverage 58.96% 59.03% +0.06%
===========================================
Files 1137 1152 +15
Lines 30324 30360 +36
Branches 6223 6220 -3
===========================================
+ Hits 17882 17923 +41
+ Misses 9764 9759 -5
Partials 2678 2678
☔ View full report in Codecov by Sentry. |
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.
Just some comments
} | ||
|
||
@Test | ||
fun `Top level function with '@Composable' annotation starting with a upper case should be placed in a file with the same name`() { |
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.
Isn't detekt already checking this (or maybe it checks something similar?)?
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.
No, Detekt is checking class name / filename, but not Composable function name / filename
} | ||
|
||
@Test | ||
fun `Data class state MUST not have default value`() { |
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.
Should we at least allow a default {}
for the event sink?
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.
This idea is to help the developer remember (by not compiling the code otherwise) that all the fields in the state should be provided when created by the presenter. So I think it's safer to enforce this for all the params.
} | ||
|
||
@Test | ||
fun `no field should have 'm' prefix`() { |
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.
:D
@@ -71,7 +71,7 @@ fun BlurHashAsyncImage( | |||
} | |||
|
|||
@Composable | |||
fun BlurHashImage( | |||
private fun BlurHashImage( |
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.
Are these visibility changes enforced by konsist too?
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.
Yes, else the file should be renamed to BlurHashImage.kt
, which mean that actually this function should be moved to its own file).
The inner rule (of mine) is: one public composable per file.
Thanks for the the review @julioromano |
Type of change
Content
Add Konsist to do some static analysis on the code.
Add some test and fixes the existing issues.
Motivation and context
More quality and consistency across the codebase.
Screenshots / GIFs
NA
Tests
Tested devices
Checklist