Added swiftlint custom rules extraction from a .swiftlint.yml file
Hi,
I added this feature : custom swiftlint rule extraction from a local .swiftlint.yml
custom_rules:
pirates_beat_ninjas: # rule identifier
included: ".*\\.swift" # regex that defines paths to include during linting. optional.
excluded: ".*Test\\.swift" # regex that defines paths to exclude during linting. optional
name: "Pirates Beat Ninjas" # rule name. optional.
regex: "([n,N]inja)" # matching pattern
match_kinds: # SyntaxKinds to match. optional.
- comment
- identifier
message: "Pirates are better than ninjas." # violation message. optional.
severity: error # violation severity. optional.
no_hiding_in_strings:
regex: "([n,N]inja)"
match_kinds: string
I found no better solution to do this has swiftlint rules must be described before the plugin packaging.
we should merge this as well.
Hi,
Did you get this working ? Because you upgraded the Groovy script to generate rule files, but once the plugin is compiled, they cannot be changed... So I don't understand how this would work 'dynamically'...
Gilles
Hi,
It doen't work "dynamicaly". You have to rebuild the plugin.
Hi @Pierre-Loup,
Does this mean someone who want to integrate his custom SwiftLint rule(s), will have to rebuild the plugin each time?
I don't think we can integrate this feature, to be honest.