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

"Colon Violation" bad phrasing #3587

Closed
2 tasks done
ghost opened this issue Mar 31, 2021 · 1 comment
Closed
2 tasks done

"Colon Violation" bad phrasing #3587

ghost opened this issue Mar 31, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 31, 2021

New Issue Checklist

Describe the bug

The colon spacing rule is named "Colon", which means it shows up in logs and in Xcode as "Colon Violation", which sounds more like a threat than a warning. Pun really-really not intended.

I propose changing the rule name to "Colon Spacing", which improves the phrasing in my opinion.

PR submitted: #3583

Complete output when running SwiftLint, including the stack trace and command used

Not relevant.

Environment

  • SwiftLint version: 0.43.1
  • Installation method used: CocoaPods
  • Paste your configuration file:
function_body_length: 80
function_parameter_count: 5
large_tuple: 3

variable_name:
  min_length:
    error: 1
    warning: 2
  excluded:
    - id
    - url

discouraged_object_literal:
  severity: error

opt_in_rules:
  - discouraged_object_literal

disabled_rules:
  - shorthand_operator
  - cyclomatic_complexity
  - force_cast
  - force_try
  - nesting
  - trailing_whitespace
  - line_length
  - file_length
  - identifier_name
  - type_name
  - function_body_length
  - function_parameter_count
  - type_body_length
  - closure_parameter_position
  - redundant_optional_initialization
  - unused_closure_parameter
  - unused_setter_value
  - redundant_objc_attribute
  - notification_center_detachment

excluded:
  - Project/
  - Codegen
  - Pods
  - DeliverooTests/Mock.generated.swift
  - Features/Account/AccountTests/Mock.generated.swift
  - Features/Restaurant/RestaurantTests/Mock.generated.swift
  - Features/OrderStatus/OrderStatusTests/Mock.generated.swift
  - Features/UGC/UgcCore/GraphQL/UgcAPI.generated.swift
  - Features/ConsumerCore/ConsumerCore/GraphQL/HomeAPI.generated.swift
  - Features/ConsumerCore/ConsumerCore/GraphQL/CheckoutAPI.generated.swift

custom_rules:
  avoid_new_auto_layout:
    included: ".*\\.swift"
    name: "Avoid using newAutoLayout()"
    regex: "(newAutoLayout\\(\\))"
    capture_group: 0
    match_kinds:
      - comment
      - identifier
    message: "Use makeForAutoLayout() instead, as per ADR-4"
    severity: error

  avoid_using_swift_assert:
    included: ".*\\.swift"
    name: "Avoid using Swift assert()"
    regex: "(assert\\()"
    capture_group: 0
    match_kinds:
      - comment
      - identifier
    message: "Use ROOAssert() from ROOUtilities instead"
    severity: error

  avoid_using_swift_assertion_failure:
    included: ".*\\.swift"
    name: "Avoid using Swift assertionFailure()"
    regex: "(assertionFailure\\()"
    capture_group: 0
    match_kinds:
      - comment
      - identifier
    message: "Use ROOAssertionFailure() from ROOUtilities instead"
    severity: error

  avoid_nslocalizedstring:
    name: "Avoid using NSLocalizedString"
    regex: "NSLocalizedString"
    capture_group: 0
    match_kinds:
      - identifier
    message: "Use Localisation enum in Assets framework instead"
    severity: error
  • Are you using nested configurations?
    If so, paste their relative paths and respective contents.
  • Which Xcode version are you using:
Xcode 12.4
Build version 12D4e
  • Do you have a sample that shows the issue?
// This triggers the "Colon Violation":
public init(from decoder : Decoder) throws { }
@sethfri
Copy link
Contributor

sethfri commented May 2, 2021

Fixed by #3583

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

No branches or pull requests

2 participants