Skip to content

Commit

Permalink
Clean up logging dependencies (#1999)
Browse files Browse the repository at this point in the history
Closes #1998
  • Loading branch information
paul-dingemans authored May 7, 2023
1 parent 7ba9ed0 commit 6500181
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
* Prevent nullpointer exception (NPE) if or operator at start of line is followed by dot qualified expression `indent` ([#1993](https://github.com/pinterest/ktlint/issues/1993))
* Fix indentation of multiline parameter list in function literal `indent` ([#1976](https://github.com/pinterest/ktlint/issues/1976))
* Restrict indentation of closing quotes to `ktlint_official` code style to keep formatting of other code styles consistent with `0.48.x` and before `indent` ([#1971](https://github.com/pinterest/ktlint/issues/1971))
* Clean-up unwanted logging dependencies ([#1998](https://github.com/pinterest/ktlint/issues/1998))

### Changed
* Separated Baseline functionality out of `ktlint-cli` into separate `ktlint-baseline` module for API consumers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package com.pinterest.ktlint.rule.engine.internal

import ch.qos.logback.classic.Level
import ch.qos.logback.classic.Logger
import com.pinterest.ktlint.logger.api.initKtLintKLogger
import com.pinterest.ktlint.logger.api.setDefaultLoggerModifier
import mu.KotlinLogging
import org.assertj.core.api.Assertions.assertThat
import org.ec4j.core.EditorConfigLoader
import org.ec4j.core.Resource
Expand All @@ -17,16 +12,6 @@ import java.nio.charset.StandardCharsets
import java.nio.file.Paths

class ThreadSafeEditorConfigCacheTest {
init {
// Overwrite default logging with TRACE logging by initializing *and* printing first log statement before
// loading any other classes.
KotlinLogging
.logger {}
.setDefaultLoggerModifier { logger -> (logger.underlyingLogger as Logger).level = Level.TRACE }
.initKtLintKLogger()
.trace { "Enable trace logging for unit test" }
}

@Test
fun `Given a file which is requested multiple times then it is read only once and then stored into and retrieved from the cache`() {
val threadSafeEditorConfigCache = ThreadSafeEditorConfigCache()
Expand Down
1 change: 0 additions & 1 deletion ktlint-ruleset-standard/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {

dependencies {
implementation(projects.ktlintLogger)
implementation(libs.logging)

api(projects.ktlintCliRulesetCore)
api(projects.ktlintRuleEngineCore)
Expand Down
1 change: 0 additions & 1 deletion ktlint-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {
implementation(projects.ktlintCliRulesetCore)
api(libs.assertj)
api(libs.junit5)
api(libs.logback)
api(libs.janino)
api(libs.jimfs)
}

0 comments on commit 6500181

Please sign in to comment.