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

Rule Request: unused control flow labels #2227

Closed
masters3d opened this issue May 31, 2018 · 1 comment
Closed

Rule Request: unused control flow labels #2227

masters3d opened this issue May 31, 2018 · 1 comment
Labels
rule-request Requests for a new rules.

Comments

@masters3d
Copy link
Contributor

Rule Request

  1. Why should this rule be added? Share links to existing discussion about what
    the community thinks about this.

Typescript just added a way to identify labels which are not being used. I think this would be really nice to have in swift as lint rule.

https://github.com/Microsoft/TypeScript/pull/24037/files

  1. Provide several examples of what would and wouldn't trigger violations.
label2:  /// label2 not being used. Consider removing
    while (true) {}

do, while, repeat should be supported

non triggering examples:

label2: 
    while (true) { break label2}
  1. Should the rule be configurable, if so what parameters should be configurable?

none

  1. Should the rule be opt-in or enabled by default? Why?
    See README.md for guidelines on when to mark a
    rule as opt-in.

probably opt in

@marcelofabri marcelofabri added the rule-request Requests for a new rules. label May 31, 2018
@jpsim
Copy link
Collaborator

jpsim commented Jun 1, 2018

It took me a bit to understand that this was about unused control flow labels, not closure parameters.

@masters3d masters3d changed the title Rule Request: unused block labels Rule Request: unused control flow labels Jun 1, 2018
sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

No branches or pull requests

3 participants