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

Comments

Projects
None yet
3 participants
@masters3d
Copy link
Contributor

masters3d commented May 31, 2018

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

@jpsim

This comment has been minimized.

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

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jan 5, 2019

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jan 6, 2019

kimdv pushed a commit to kimdv/SwiftLint that referenced this issue Jan 6, 2019

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