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

Feature request: Please allow consecutive spaces prior to a trailing comment. #408

Open
nallick opened this issue Apr 6, 2019 · 2 comments

Comments

@nallick
Copy link

nallick commented Apr 6, 2019

Version: 0.40.4

Consecutive spaces within code are frequently different than consecutive spaces before an inline comment. For example, here the comment may be intended to have some extra space to separate it from the code, but it's still desirable to remove the extra space in the code.

var    i =   1      // one based index

Here's typical example were the space before the comment may be desirable.

enum Algorithm: Int {
    case aes = 0        // kCCAlgorithmAES
    case des            // kCCAlgorithmDES
    case tripleDES      // kCCAlgorithm3DES
    case cast           // kCCAlgorithmCAST
    case rc4            // kCCAlgorithmRC4
    case rc2            // kCCAlgorithmRC2
    case blowfish       // kCCAlgorithmBlowfish
}

versus:

enum Algorithm: Int {
    case aes = 0 // kCCAlgorithmAES
    case des // kCCAlgorithmDES
    case tripleDES // kCCAlgorithm3DES
    case cast // kCCAlgorithmCAST
    case rc4 // kCCAlgorithmRC4
    case rc2 // kCCAlgorithmRC2
    case blowfish // kCCAlgorithmBlowfish
}
@nicklockwood
Copy link
Owner

nicklockwood commented Apr 7, 2019

@nallick I see your point, however I don't think this is unique to inline comments, e.g. this pattern is quite common too:

struct Foo {
  var someVar              = 4
  var aLongerVariable      = 6
  var foo                  = 7
}

I'm not yet sure what the best way to handle this is, but I probably need a solution for both.

@nallick
Copy link
Author

nallick commented Apr 8, 2019

That's fair

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

No branches or pull requests

2 participants