Skip to content

Commit f931eab

Browse files
Revive excludedPaths by stopping double resolution
This commit stops resolving a path to an absolute path in Configuration.groupFiles. This will resolve the issue mentioned in comments in #6795 that the "excluded" configuration in .swiftlint.yml is ignored when file paths are passed as arguments.
1 parent 29d5c2b commit f931eab

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
[SimplyDanny](https://github.com/SimplyDanny)
2727
[#5740](https://github.com/realm/SwiftLint/issues/5740)
2828

29+
* Fix `excluded` configuration being ignored when file paths are passed as arguments.
30+
[Tomotaka Takahashi](https://github.com/tomotakatakahashi)
31+
[#6795](https://github.com/realm/SwiftLint/issues/6795)
32+
2933
## 0.65.1: Fresh Folded Fixtures
3034

3135
### Breaking

‎Source/SwiftLintFramework/Configuration+CommandLine.swift‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,9 @@ extension Configuration {
118118

119119
return files.parallelFilterGroup { file in
120120
let fileConfiguration = configuration(for: file)
121-
let fileConfigurationRootPath = fileConfiguration.rootDirectory
122121

123122
// Files whose configuration specifies they should be excluded will be skipped
124-
let shouldSkip = fileConfiguration.excludedPaths.contains { excludedRelativePath in
125-
let excludedPath = fileConfigurationRootPath.appending(path: excludedRelativePath.relativePath)
123+
let shouldSkip = fileConfiguration.excludedPaths.contains { excludedPath in
126124
let filePathComponents = file.path?.pathComponents ?? []
127125
let excludedPathComponents = excludedPath.pathComponents
128126
return filePathComponents.starts(with: excludedPathComponents)

0 commit comments

Comments
 (0)