To reproduce the problem, create the following directories and files.
test/.swiftlint.yml
test/subdir/.swiftlint.yml
test/subdir/a.swift
Both the .swiftlint.yml are empty, and a.swift just has one line:
let a = 0
Then run SwiftLint in the test/ directory:
$ swiftlint lint
Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'a.swift' (1/1)
xxxx/test/subdir/a.swift:1:1: error: Variable Name Violation: Variable name should be between 3 and 40 characters long: 'a' (variable_name)
Done linting! Found 1 violation, 1 serious in 1 file.
Then change test/subdir/.swiftlint.yml to the following:
disabled_rules:
- variable_name
Then if you run SwiftLint in the test/ directory once again, you get the same output, even though there shouldn't be anymore warning.
$ swiftlint lint
Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'a.swift' (1/1)
/tmp/test/subdir/a.swift:1:1: error: Variable Name Violation: Variable name should be between 3 and 40 characters long: 'a' (variable_name)
Done linting! Found 1 violation, 1 serious in 1 file.
If you run it disabling the cache everything works fine:
$ swiftlint lint --no-cache
Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'a.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 file.
I suspect there are several of these types of issues with the current caching implementation...
Another problem is that we should consider the CLI parameters to invalidate the cache 馃槵
Yes, was thinking about that too...
Let's close this to keep the discussion about cache issues localized in #1184.
Most helpful comment
I suspect there are several of these types of issues with the current caching implementation...