Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added swiftlint custom rules extraction from a .swiftlint.yml file #130

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Pierre-Loup
Copy link

@Pierre-Loup Pierre-Loup commented Mar 28, 2018

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.

@singh88
Copy link

singh88 commented Apr 20, 2018

we should merge this as well.

@zippy1978
Copy link
Contributor

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

@Pierre-Loup
Copy link
Author

Hi,

It doen't work "dynamicaly". You have to rebuild the plugin.

@gaelfoppolo
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants