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

DisallowSpaceBeforeTokenChecker should offer option to ignore context bounds #275

Open
marconilanna opened this issue Aug 23, 2017 · 0 comments
Labels

Comments

@marconilanna
Copy link
Contributor

@marconilanna marconilanna commented Aug 23, 2017

Having DisallowSpaceBeforeTokenChecker enabled for SEMICOLON is very useful to enforce the official Scala Style Guide conventions:

Type annotations should be patterned according to the following template:

value: Type

This is the style adopted by most of the Scala standard library and all of Martin Odersky’s examples. The space between value and type helps the eye in accurately parsing the syntax. The reason to place the colon at the end of the value rather than the beginning of the type is to avoid confusion in cases such as this one:

value :::

However, it breaks context bounds convention:

def f[A : ClassTag](n: Int) = new Array[A](n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.