Swiftlint: Cache not updated for a subdirectory when its .swiftlint.yml changes

Created on 24 Jan 2017  路  4Comments  路  Source: realm/SwiftLint

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.
bug

Most helpful comment

I suspect there are several of these types of issues with the current caching implementation...

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrtj picture mrtj  路  3Comments

zntfdr picture zntfdr  路  3Comments

msanders picture msanders  路  4Comments

Den-Ree picture Den-Ree  路  3Comments

jcarroll-mediafly picture jcarroll-mediafly  路  3Comments