From 9751adcc9d6997cd39fd0c5606aa93e2c42701a2 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Fri, 17 Jun 2022 11:44:44 +0200 Subject: [PATCH] Rename --- Ignore/Sources/Ignore/Ignore.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Ignore/Sources/Ignore/Ignore.swift b/Ignore/Sources/Ignore/Ignore.swift index 03a1bb06..1fbfc015 100644 --- a/Ignore/Sources/Ignore/Ignore.swift +++ b/Ignore/Sources/Ignore/Ignore.swift @@ -25,7 +25,7 @@ public class Ignore { return Ignore(base: base, parent: nil, ignoreFileUrls: urls, prepend: vcsFolderFilters) } - public let ignores: [Filter] + public let filters: [Filter] /// `ignoreFileUrls[n]` overrides `ignoreFileUrls[n + 1]`. /// `Ignore`s of `parent` are overridden, if applicable, by the `Ignore`s found in `base`. @@ -39,7 +39,7 @@ public class Ignore { if ignoreFileUrls.isEmpty { return nil } let urls = ignoreFileUrls.filter { fm.fileExists(atPath: $0.path) }.reversed() - self.ignores = (parent?.ignores ?? []) + self.filters = (parent?.filters ?? []) + prepend.reversed() + urls.flatMap { FileLineReader(url: $0, encoding: .utf8) @@ -49,19 +49,19 @@ public class Ignore { } + append.reversed() - if self.ignores.isEmpty { return nil } + if self.filters.isEmpty { return nil } - if let lastAllowIndex = self.ignores + if let lastAllowIndex = self.filters .enumerated() .filter({ _, ignore in ignore.isAllow }) .map(\.offset) .max() { - self.mixedIgnores = self.ignores[0...lastAllowIndex] - self.remainingDisallowIgnores = self.ignores[(lastAllowIndex + 1)...] + self.mixedIgnores = self.filters[0...lastAllowIndex] + self.remainingDisallowIgnores = self.filters[(lastAllowIndex + 1)...] } else { self.mixedIgnores = ArraySlice() - self.remainingDisallowIgnores = self.ignores[0...] + self.remainingDisallowIgnores = self.filters[0...] } }