-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix: Enhance table builder logic #2043
fix: Enhance table builder logic #2043
Conversation
Timestamp: 2021-06-25 07:36:30 |
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.
My proposition is to change Alignment
to Align
just because is shorter.
de07d2f
to
f031c40
Compare
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.
Minor comment, else looks good!
@@ -145,3 +157,11 @@ private fun DataWithSize.center() = String.format( | |||
) | |||
|
|||
inline fun TableColumn.applyColorsUsing(mapper: (String) -> SystemOutColor) = copy(dataColor = data.map(mapper)) | |||
|
|||
// RESOLUTION column needs dedicated alignment logic and data pre-processing |
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.
Is this a todo or something that has been achieved?
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.
It's not a todo, it's just a short info why we have additional method here
test_runner/src/main/kotlin/ftl/environment/TestEnvironmentInfo.kt
Outdated
Show resolved
Hide resolved
c448769
to
1018578
Compare
@@ -12,16 +12,19 @@ data class TableColumn( | |||
val header: String, | |||
val data: List<String>, | |||
val dataColor: List<SystemOutColor> = listOf(), | |||
val columnSize: Int = ((data + header).maxByOrNull { it.length }?.length ?: 0) + DEFAULT_COLUMN_PADDING | |||
val columnSize: Int = ((data + header).maxByOrNull { it.length }?.length ?: 0) + DEFAULT_COLUMN_PADDING, | |||
val align: Align |
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.
As @piotradamczyk5 mentioned, Align.LEFT could set as default, also here.
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.
@jan-gogo @piotradamczyk5
IMO it's clearer to force explicit alignment set up and I do not fully agree with you.
On the other hand I don't have very strong opinion about it and I'm in minority in that case, so sure, I'll change it 👍🏻
Fixes #1893
Test Plan
./gradlew flankFullRun
flank firebase test android models list
OS_VERSION_IDS
column aligned to the leftRESOLUTION
column centered byx
mark