SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Allow different name and message for existing rules

Open MathVasc opened this issue 4 years ago • 1 comments

I have been using SwiftLint to create a Style Guide checker and for this, I'm using existing rules and custom rules. The custom rules allow setting a custom name and message which is great for defining the Guide topic, like so:

empty_line_before_closing_brace:
    name: "Style Guide: 2.1 New Line"
    included: ".*\\.swift" 
    regex: '\S\n\}'
    message: "All declarations must have an empty line before closing brace (URL for Guide topic)"
    severity: error

Although, the existing rules only allow to change the severity and set some properties for specific rules.

opt_in_rules:
  - explicit_acl # Style Guide: 2.2 Access Modifier

explicit_acl:
  severity: error

It would be great to be able to change the current name and message to explicitly refer to the Style Guide.

opt_in_rules:
  - explicit_acl # Style Guide: 2.2 Access Modifier

explicit_acl:
  severity: error
  name: "Style Guide: 2.2 Access Modifier"
  message: "All declarations must have explicitly Access Modifier (URL for Guide topic)"

MathVasc avatar Feb 10 '21 19:02 MathVasc

any updates on this?

karim-alweheshy avatar Nov 15 '22 17:11 karim-alweheshy