Skip to content

Commit

Permalink
Fixed .editorconfig loading
Browse files Browse the repository at this point in the history
Was only looking in current module.

Fixes #507
Fixes #508
  • Loading branch information
freemanjp committed Aug 28, 2022
1 parent a56fb8d commit 71a1aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Expand Up @@ -181,14 +181,12 @@ internal abstract class AbstractCheckSupport(

val sourceFiles = ds.includedFiles.map { File(sourceRoot, it) }

val workingDir = File(".").absoluteFile

sourceFiles.forEach { file ->
if (!checkedFiles.add(file.canonicalFile)) {
return@forEach
}

val workingRelativePath = file.toRelativeString(workingDir)
val absolutePath = file.absolutePath
val baseRelativePath = file.toRelativeString(basedir)
reporter.before(baseRelativePath)

Expand All @@ -202,7 +200,7 @@ internal abstract class AbstractCheckSupport(
val sourceText = file.readText(charset)

lintFile(
workingRelativePath,
absolutePath,
sourceText,
ruleProviders,
{ error ->
Expand Down
Expand Up @@ -87,14 +87,12 @@ internal class Format(

val sourceFiles = ds.includedFiles.map { File(sourceRoot, it) }

val workingDir = File(".").absoluteFile

sourceFiles.forEach { file ->
if (!checkedFiles.add(file.canonicalFile)) {
return@forEach
}

val workingRelativePath = file.toRelativeString(workingDir)
val absolutePath = file.absolutePath
val baseRelativePath = file.toRelativeString(basedir)

log.debug("checking format: $baseRelativePath")
Expand All @@ -107,7 +105,7 @@ internal class Format(
val sourceText = file.readText(charset)

val formattedText = formatFile(
workingRelativePath,
absolutePath,
sourceText,
ruleProviders,
{ (line, col, _, detail), corrected ->
Expand Down

0 comments on commit 71a1aee

Please sign in to comment.