Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import dev.detekt.gradle.Detekt
import dev.detekt.gradle.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
Expand Down Expand Up @@ -77,36 +77,51 @@ rootProject.plugins.withType<YarnPlugin> {

// configure detekt
extensions.configure<DetektExtension> {
parallel = true
parallel.set(true)
buildUponDefaultConfig.set(true)
source.setFrom(files("src/jsMain/kotlin"))
config.setFrom(files("$rootDir/detekt.yml"))
buildUponDefaultConfig = true
}
dependencies {
"detektPlugins"(libs.detekt.formatting)
"detektPlugins"(libs.detekt.ktlint.wrapper)
}

tasks.register<Detekt>("ktlintCheck") {
description = "Run detekt ktlint wrapper"
parallel = true
parallel.set(true)
setSource(files("src/jsMain/kotlin"))
config.setFrom(files("$rootDir/detekt-formatting.yml"))
buildUponDefaultConfig = true
disableDefaultRuleSets = true
autoCorrect = false
buildUponDefaultConfig.set(true)
disableDefaultRuleSets.set(true)
autoCorrect.set(false)
reports {
xml {
checkstyle {
required.set(true)
outputLocation.set(layout.buildDirectory.file("reports/detekt/detektFormatting.xml"))
outputLocation.set(layout.buildDirectory.file("reports/detekt/ktlint-check.xml"))
}
html.required.set(false)
txt.required.set(false)
}
include(listOf("**/*.kt", "**/*.kts"))
exclude("build/")
dependencies {
"detektPlugins"(libs.detekt.formatting)
}

tasks.register<Detekt>("ktlintFormat") {
description = "Run detekt ktlint wrapper"
parallel.set(true)
setSource(files("src/jsMain/kotlin"))
config.setFrom(files("$rootDir/detekt-formatting.yml"))
buildUponDefaultConfig.set(true)
disableDefaultRuleSets.set(true)
autoCorrect.set(true)
reports {
checkstyle {
required.set(true)
outputLocation.set(layout.buildDirectory.file("reports/detekt/ktlint-format.xml"))
}
html.required.set(false)
}
include(listOf("**/*.kt", "**/*.kts"))
exclude("build/")
}

// configure dependency updates
Expand Down
6 changes: 1 addition & 5 deletions detekt-formatting.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
build:
maxIssues: 0
excludeCorrectable: true

console-reports:
exclude:
- 'ProjectStatisticsReport'
Expand All @@ -11,7 +7,7 @@ console-reports:
- 'FileBasedFindingsReport'
- 'LiteFindingsReport'

formatting:
ktlint:
ImportOrdering:
active: true
Indentation:
Expand Down
32 changes: 22 additions & 10 deletions detekt.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
performance:
SpreadOperator:
active: false
console-reports:
exclude:
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'NotificationReport'
- 'FileBasedFindingsReport'
- 'LiteFindingsReport'

complexity:
ComplexCondition:
allowedConditions: 5
CyclomaticComplexMethod:
ignoreSingleWhenExpression: true

naming:
FunctionNaming:
functionPattern: "[a-z][a-zA-Z0-9]*"
ignoreAnnotated: [ 'Composable' ]
TopLevelPropertyNaming:
constantPattern: '[A-Z][_A-Z0-9]*|[A-Z][A-Za-z0-9]*'

style:
MagicNumber:
active: false
NewLineAtEndOfFile:
active: false

naming:
FunctionNaming:
ignoreAnnotated:
- 'Composable'

formatting:
active: false
ktlint:
active: false
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
coroutines = "1.10.2"
detekt = "1.23.8"
detekt = "2.0.0-alpha.2"
gradleVersionsPlugin = "0.52.0"
jetbrainsCompose = "1.10.3"
kotlin = "2.3.20"
Expand All @@ -12,11 +12,11 @@ webpackDevServer = "5.0.4"
compose-html-core = { module = "org.jetbrains.compose.html:html-core", version.ref = "jetbrainsCompose" }
compose-html-svg = { module = "org.jetbrains.compose.html:html-svg", version.ref = "jetbrainsCompose" }
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrainsCompose" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
detekt-ktlint-wrapper = { module = "dev.detekt:detekt-rules-ktlint-wrapper", version.ref = "detekt" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }

[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
detekt = { id = "dev.detekt", version.ref = "detekt" }
gradleVersions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersionsPlugin" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrainsCompose" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private fun social() {
attrs = {
target(ATarget.Blank)
classes(Style.AboutMe.profileLink)
}
},
) {
Div({
style {
Expand Down Expand Up @@ -151,7 +151,7 @@ private fun experiment(experiment: Experiment, styleBlock: StyleScope.() -> Unit
href = experiment.link,
attrs = {
classes(Style.Grid.span6, Style.Experiment.container)
}
},
) {
Div({ classes(Style.Experiment.containerOverlay) }) {
P({ classes(Style.Section.title2) }) { Text(experiment.title) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fun image() {
images.forEach {
Img(
src = "assets/$it.jpg",
attrs = { classes(Style.profileImage, addStyle(image == it)) }
attrs = { classes(Style.profileImage, addStyle(image == it)) },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun project(project: Project, showViewMore: Boolean, styleBlock: StyleScope.() -
attrs = {
target(ATarget.Blank)
classes(Style.Projects.containerOverlay)
}
},
) {
Div({ classes(Style.Projects.containerInner) }) {
P({ classes(Style.Section.title2) }) { Text(project.title) }
Expand All @@ -58,7 +58,7 @@ private fun viewMore() {
width(.5.cssRem)
height(.5.cssRem)
fill("none")
}
},
) {
Path(
d = "M6.8291 6.82849L6.8291 1.17163M6.8291 1.17163L1.17225 1.17163M6.8291 1.17163L1.17188 6.82849",
Expand Down
4 changes: 2 additions & 2 deletions src/jsMain/kotlin/de/nilsdruyen/portfolio/components/Work.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ private fun interests() {
attrs = {
target(ATarget.Blank)
classes(Style.Work.interestLink)
}
},
) {
Img(
src = "assets/${interest.iconName}.svg",
attrs = {
style {
height(interest.iconHeight.px)
}
}
},
)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/jsMain/kotlin/de/nilsdruyen/portfolio/model/Data.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ object Model {
Project(
"Gradle FTP upload plugin",
"Gradle plugin for uploading files via ftp",
"https://github.com/nilsjr/gradle-ftp-upload-plugin"
"https://github.com/nilsjr/gradle-ftp-upload-plugin",
),
Project(
"WoWMythicPlus",
"\uD83D\uDD11 WoW M+ overview displaying data from raider.io api",
"https://github.com/nilsjr/WoWMythicPlus"
"https://github.com/nilsjr/WoWMythicPlus",
),
)

Expand All @@ -86,12 +86,12 @@ object Model {
Project(
"accompanist",
"A collection of extension libraries for Jetpack Compose",
"https://github.com/google/accompanist"
"https://github.com/google/accompanist",
),
Project(
"azure-gradle-plugins",
"About Azure Plugins for Gradle",
"https://github.com/microsoft/azure-gradle-plugins"
"https://github.com/microsoft/azure-gradle-plugins",
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@

package de.nilsdruyen.portfolio.model

data class Experiment(
val title: String,
val subtitle: String,
val link: String,
)
data class Experiment(val title: String, val subtitle: String, val link: String)
7 changes: 1 addition & 6 deletions src/jsMain/kotlin/de/nilsdruyen/portfolio/model/Interest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@

package de.nilsdruyen.portfolio.model

data class Interest(
val name: String,
val link: String,
val iconName: String,
val iconHeight: Int = 50,
)
data class Interest(val name: String, val link: String, val iconName: String, val iconHeight: Int = 50)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ import androidx.compose.runtime.Composable
import org.jetbrains.compose.web.attributes.AttrsScope
import org.w3c.dom.svg.SVGElement

data class ProfileLink(
val link: String,
val icon: @Composable (AttrsScope<SVGElement>.() -> Unit) -> Unit = {},
)
data class ProfileLink(val link: String, val icon: @Composable (AttrsScope<SVGElement>.() -> Unit) -> Unit = {})
6 changes: 1 addition & 5 deletions src/jsMain/kotlin/de/nilsdruyen/portfolio/model/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@

package de.nilsdruyen.portfolio.model

data class Project(
val title: String,
val subtitle: String,
val link: String,
)
data class Project(val title: String, val subtitle: String, val link: String)
7 changes: 1 addition & 6 deletions src/jsMain/kotlin/de/nilsdruyen/portfolio/model/Work.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@

package de.nilsdruyen.portfolio.model

data class Work(
val timeFrame: String,
val result: String,
val role: String,
val name: String,
)
data class Work(val timeFrame: String, val result: String, val role: String, val name: String)
12 changes: 6 additions & 6 deletions src/jsMain/kotlin/de/nilsdruyen/portfolio/ui/Icons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object Icons {
width(ICON_SIZE)
height(ICON_SIZE)
attrBlock()
}
},
) { Path(d = GITHUB) }
}

Expand All @@ -44,7 +44,7 @@ object Icons {
width(ICON_SIZE)
height(ICON_SIZE)
attrBlock()
}
},
) { Path(d = TWITTER_X) }
}

Expand All @@ -57,7 +57,7 @@ object Icons {
width(ICON_SIZE)
height(ICON_SIZE)
attrBlock()
}
},
) { Path(d = INSTAGRAM) }
}

Expand All @@ -70,7 +70,7 @@ object Icons {
width(ICON_SIZE)
height(ICON_SIZE)
attrBlock()
}
},
) { Path(d = XING) }
}

Expand All @@ -83,7 +83,7 @@ object Icons {
width(ICON_SIZE)
height(ICON_SIZE)
attrBlock()
}
},
) { Path(d = LINKEDIN) }
}

Expand All @@ -96,7 +96,7 @@ object Icons {
width(24)
height(24)
fill(Style.textColor.value().toString())
}
},
) {
Path(d = if (isDark) DARK_MODE_FILLED else DARK_MODE)
}
Expand Down
2 changes: 1 addition & 1 deletion src/jsMain/kotlin/de/nilsdruyen/portfolio/ui/Style.kt
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ object Style : StyleSheet() {
backgroundPosition("50%")
property(
"background-image",
"url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 0.75C1.5 1.16421 1.16421 1.5 0.75 1.5C0.335786 1.5 0 1.16421 0 0.75C0 0.335786 0.335786 0 0.75 0C1.16421 0 1.5 0.335786 1.5 0.75Z' fill='%23D7DDE4'/%3E%3C/svg%3E%0A\")"
"url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 0.75C1.5 1.16421 1.16421 1.5 0.75 1.5C0.335786 1.5 0 1.16421 0 0.75C0 0.335786 0.335786 0 0.75 0C1.16421 0 1.5 0.335786 1.5 0.75Z' fill='%23D7DDE4'/%3E%3C/svg%3E%0A\")",
)
}
}
Expand Down
Loading