Skip to content

Rule Request: Enforcing one space after slashes for comments #3233

Closed
@noahsark769

Description

New Issue Checklist

New rule request

I looked around for this rule but didn't see it, so let me know if I missed it. It would be nice to have a rule which fails when inline comments (double-slash style) don't have one space between the double-slashes and the first text character.

Violations:

//something
    //something
//  something

Non-triggering examples:

// something
    // something

I think that most people feel that one space after the slashes is easier to read (though to be fair I don't have hard evidence, only anecdotal). All the Xcode templates and Apple sample code that I've seen, for example, use exactly one space after the slashes. Happy to make this an opt-in rule.

Metadata

Assignees

No one assigned

    Labels

    rule-requestRequests for a new rules.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions