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

Show description of rule #1078

Closed
RishabhTayal opened this Issue Dec 28, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@RishabhTayal

RishabhTayal commented Dec 28, 2016

It would be nice to show the description of the rule when running the swiftlint rules command.

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Dec 28, 2016

Collaborator

@RishabhTayal, thanks for the suggestion, however I feel that the table would be to large in that case. We already have an issue because of it (#1002).

However, you can use swiftlint rules [rule_id] to check all the information about one rule.

For example:

$ swiftlint rules comma
Comma Spacing (comma): There should be no space before and one after any comma.

Triggering Examples (violation is marked with '↓'):

Example #1

    func abc(a: String↓ ,b: String) { }

Example #2

    func abc(a: String↓ ,b: String↓ ,c: String↓ ,d: String) { }

Example #3

    abc(a: "string"↓,b: "string"

Example #4

    enum a { case a↓ ,b }

Example #5

    let result = plus(
        first: 3↓ , // #683
        second: 4
    )
    

Would that solve the issue for you?

Collaborator

marcelofabri commented Dec 28, 2016

@RishabhTayal, thanks for the suggestion, however I feel that the table would be to large in that case. We already have an issue because of it (#1002).

However, you can use swiftlint rules [rule_id] to check all the information about one rule.

For example:

$ swiftlint rules comma
Comma Spacing (comma): There should be no space before and one after any comma.

Triggering Examples (violation is marked with '↓'):

Example #1

    func abc(a: String↓ ,b: String) { }

Example #2

    func abc(a: String↓ ,b: String↓ ,c: String↓ ,d: String) { }

Example #3

    abc(a: "string"↓,b: "string"

Example #4

    enum a { case a↓ ,b }

Example #5

    let result = plus(
        first: 3↓ , // #683
        second: 4
    )
    

Would that solve the issue for you?

@RishabhTayal

This comment has been minimized.

Show comment
Hide comment
@RishabhTayal

RishabhTayal Dec 28, 2016

Thanks for quick response. I think it would be nice to see description of all rules at once. How about a new command swiflint rules_description or swiflint rules description?

RishabhTayal commented Dec 28, 2016

Thanks for quick response. I think it would be nice to see description of all rules at once. How about a new command swiflint rules_description or swiflint rules description?

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Dec 28, 2016

Collaborator

I think a subcommand would be nice but I have doubts on how readable would it be. IMO the better approach would be having a command that generated markdown and we would keep it in this repo so people could it all of this formatted.

Collaborator

marcelofabri commented Dec 28, 2016

I think a subcommand would be nice but I have doubts on how readable would it be. IMO the better approach would be having a command that generated markdown and we would keep it in this repo so people could it all of this formatted.

@RishabhTayal

This comment has been minimized.

Show comment
Hide comment
@RishabhTayal

RishabhTayal Dec 28, 2016

That would work too. 👍

RishabhTayal commented Dec 28, 2016

That would work too. 👍

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Jan 2, 2017

Collaborator

I've taken a shot on generating a markdown: https://gist.github.com/marcelofabri/7f568c40030bb672e62f72911e0392fc

It's currently missing rules configurations.

Collaborator

marcelofabri commented Jan 2, 2017

I've taken a shot on generating a markdown: https://gist.github.com/marcelofabri/7f568c40030bb672e62f72911e0392fc

It's currently missing rules configurations.

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