Skip to content

Commit

Permalink
Reformat with spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
PatilShreyas committed Mar 24, 2024
1 parent b42d4fa commit 7b6c3ee
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fun main(args: Array<String>) {
includeStableComposables = arguments.includeStableComposables,
includeStableClasses = arguments.includeStableClasses,
includeClasses = arguments.includeClasses,
showOnlyUnstableComposables = arguments.showOnlyUnstableComposables
showOnlyUnstableComposables = arguments.showOnlyUnstableComposables,
),
)
val rawReportProvider = arguments.getRawReportProvider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ abstract class ComposeCompilerReportGenerateTask : DefaultTask() {
includeStableComposables = includeStableComposables.get(),
includeStableClasses = includeStableClasses.get(),
includeClasses = includeClasses.get(),
showOnlyUnstableComposables = showOnlyUnstableComposables.get()
showOnlyUnstableComposables = showOnlyUnstableComposables.get(),
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ data class ReportOptions(
val includeStableComposables: Boolean = true,
val includeStableClasses: Boolean = true,
val includeClasses: Boolean = true,
val showOnlyUnstableComposables: Boolean = false
val showOnlyUnstableComposables: Boolean = false,
)
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@ fun BODY.OnlyUnstableComposables(composablesReport: ComposablesReport) {
ComposablesReport(
includeStableComposables = false,
onlyUnstableComposables = true,
composablesReport = composablesReport
composablesReport = composablesReport,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun HTML.MainContent(
hr { }
ComposablesReport(
includeStableComposables = options.includeStableComposables,
composablesReport = composablesReport
composablesReport = composablesReport,
)
hr { }
if (options.includeClasses) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/**
* MIT License
*
* Copyright (c) 2022 Shreyas Patil
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.shreyaspatil.composeCompilerMetricsGenerator.generator.content.common

import dev.shreyaspatil.composeCompilerMetricsGenerator.generator.style.setStyle
Expand All @@ -8,7 +31,7 @@ import kotlinx.html.span
fun FlowOrPhrasingContent.IconWithText(
icon: SPAN.() -> Unit,
text: String,
fontSize: String = "18px"
fontSize: String = "18px",
) {
span {
setStyle(alignItems = "center", display = "flex", fontSize = fontSize)
Expand All @@ -20,27 +43,26 @@ fun FlowOrPhrasingContent.IconWithText(

fun FlowOrPhrasingContent.CrossIconWithText(
text: String,
fontSize: String = "18px"
fontSize: String = "18px",
) {
IconWithText(
icon = {
cross(width = fontSize, height = fontSize)
},
text = text,
fontSize = fontSize
fontSize = fontSize,
)
}

fun FlowOrPhrasingContent.CheckIconWithText(
text: String,
fontSize: String = "18px"
fontSize: String = "18px",
) {
IconWithText(
icon = {
check(width = fontSize, height = fontSize)
},
text = text,
fontSize = fontSize
fontSize = fontSize,
)
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/**
* MIT License
*
* Copyright (c) 2022 Shreyas Patil
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.shreyaspatil.composeCompilerMetricsGenerator.generator.content.common

import dev.shreyaspatil.composeCompilerMetricsGenerator.generator.style.Colors
Expand All @@ -12,7 +35,7 @@ fun FlowOrPhrasingContent.cross(width: String, height: String, fill: String = Co
fillRule = "evenodd",
clipRule = "evenodd",
d = "M11 13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V10C13 9.44772 12.5523 9 12 9C11.4477 9 11 9.44772 11 10V13ZM13 15.9888C13 15.4365 12.5523 14.9888 12 14.9888C11.4477 14.9888 11 15.4365 11 15.9888V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V15.9888ZM9.37735 4.66136C10.5204 2.60393 13.4793 2.60393 14.6223 4.66136L21.2233 16.5431C22.3341 18.5427 20.8882 21 18.6008 21H5.39885C3.11139 21 1.66549 18.5427 2.77637 16.5431L9.37735 4.66136Z",
pathFill = fill
pathFill = fill,
)
}

Expand All @@ -25,6 +48,6 @@ fun FlowOrPhrasingContent.check(width: String, height: String, fill: String = Co
fillRule = "evenodd",
clipRule = "evenodd",
d = "M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.0303 8.96967C16.3232 9.26256 16.3232 9.73744 16.0303 10.0303L11.0303 15.0303C10.7374 15.3232 10.2626 15.3232 9.96967 15.0303L7.96967 13.0303C7.67678 12.7374 7.67678 12.2626 7.96967 11.9697C8.26256 11.6768 8.73744 11.6768 9.03033 11.9697L10.5 13.4393L12.7348 11.2045L14.9697 8.96967C15.2626 8.67678 15.7374 8.67678 16.0303 8.96967Z",
pathFill = fill
pathFill = fill,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/**
* MIT License
*
* Copyright (c) 2022 Shreyas Patil
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.shreyaspatil.composeCompilerMetricsGenerator.generator.content.common

import dev.shreyaspatil.composeCompilerMetricsGenerator.generator.style.setStyle
Expand All @@ -19,9 +42,8 @@ fun FlowOrPhrasingContent.SvgIcon(
fillRule: String,
clipRule: String,
d: String,
pathFill: String
pathFill: String,
) {

svg {
setStyle(width = width, height = height)
attributes.run {
Expand All @@ -40,11 +62,15 @@ fun FlowOrPhrasingContent.SvgIcon(
/**
* Represents as a `path` for SVG
*/
class SvgPath(consumer: TagConsumer<*>) : HTMLTag(
"path", consumer, emptyMap(),
inlineTag = true,
emptyTag = false
), HtmlInlineTag {
class SvgPath(consumer: TagConsumer<*>) :
HTMLTag(
tagName = "path",
consumer = consumer,
initialAttributes = emptyMap(),
inlineTag = true,
emptyTag = false,
),
HtmlInlineTag {
var fillRule: String
get() = attributes["fill-rule"].toString()
set(newValue) {
Expand Down Expand Up @@ -72,4 +98,4 @@ class SvgPath(consumer: TagConsumer<*>) : HTMLTag(

fun FlowOrPhrasingContent.path(block: SvgPath.() -> Unit = {}) {
SvgPath(consumer).visit(block)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun HTMLTag.setStyle(
margin = margin,
padding = padding,
alignItems = alignItems,
display = display
display = display,
)
}

Expand Down Expand Up @@ -89,7 +89,7 @@ fun DelegatingMap.setStyle(
margin = margin,
padding = padding,
alignItems = alignItems,
display = display
display = display,
),
)
}
Expand All @@ -100,7 +100,7 @@ fun buildStyle(
fontSize: String? = null,
textAlign: String? = null,
width: String? = null,
height: String?= null,
height: String? = null,
margin: String? = null,
padding: String? = null,
alignItems: String? = null,
Expand Down

0 comments on commit 7b6c3ee

Please sign in to comment.