Hello,
I'm trying to included some file to the SwiftLint file.
But I can't add every swift file of a folder :
included:
- ../MyFolder/Classes/Controller/MyFile.swift # work fine
- ../MyFolder/Classes/Controller/*.swift #didn't work , none of the .swift file in the Controller folder are checked are compilation.
Any idea ? Probably the syntax ?
included doesn't use shell-like file globbing syntax, it uses regular expression syntax. Try this:
../MyFolder/Classes/Controller/.*.swift
Hello, thank you for your response :)
But with :
../MyFolder/Classes/Controller/.*.swift
File are not include :/
Oops, I was totally wrong. included/excluded don't use regular expression syntax at all, it doesn't do any wildcard expansion of any kind. See https://github.com/realm/SwiftLint/blob/0.13.0/Source/SwiftLintFramework/Models/Configuration.swift#L189-L199
So instead of ../MyFolder/Classes/Controller/*.swift you should specify the root directory: ../MyFolder/Classes/Controller.
Work fine ! Thank you !!!
@jpsim does that mean the example in the readme is wrong?
- Source/*/ExcludedFile.swift # Exclude files with a wildcard
https://github.com/realm/SwiftLint/blame/master/README.md#L318
@fabb This feature has been recently added, so the README is correct.
Is it included in 0.27.0? I couldn鈥榯 get it to work 馃槙
Note that globs are only supported when _excluding_ files, not _including_ them.
Yeah I tried globs in excluding, didn鈥榯 work. Will try again, maybe it was a special combination that caused issues. Also I tried starting with a glob (*/filename.swift), that even made swiftlint throw an error.
Most helpful comment
Note that globs are only supported when _excluding_ files, not _including_ them.