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

Allow lines longer than 100 symbols if it contains a URI #112

Closed
Ilya-Gh opened this issue Nov 24, 2017 · 2 comments
Closed

Allow lines longer than 100 symbols if it contains a URI #112

Ilya-Gh opened this issue Nov 24, 2017 · 2 comments

Comments

@Ilya-Gh
Copy link
Contributor

Ilya-Gh commented Nov 24, 2017

As stated per Android Kotlin Style guide one of the limit exceptions are cases when:

Lines where obeying the column limit is not possible (for example, a long URL in KDoc).

I would suggest adding this exception to the max-line-length rule to allow the following cases:

/**
 * "https://www.google.com/search?q=ktlint&rlz=1C5CHFA_enMD736MD737&oq=ktlint+&aqs=chrome..69i57j69i60l4j69i59.1286j0j4&sourceid=chrome&ie=UTF-8"
 */
loadUrl("https://www.google.com/search?q=ktlint&rlz=1C5CHFA_enMD736MD737&oq=ktlint+&aqs=chrome..69i57j69i60l4j69i59.1286j0j4&sourceid=chrome&ie=UTF-8")

I am willing to submit a PR to add the exception if it will be approved.

@shyiko
Copy link
Collaborator

shyiko commented Nov 24, 2017

Hi @Ilya-Gh.

Thank you for the ticket and PR offer.

max-line-length is now suppressed in the context of KDoc.

I'm not sure about second example, though. Considering that this a regular code I feel like "where obeying the column limit is not possible" rule no longer applies here, as it can be rewritten to something like:

loadUrl("https://www.google.com/search" +
    "?q=ktlint" +
    "&rlz=1C5CHFA_enMD736MD737" +
    "&oq=ktlint+" +
    "&aqs=chrome..69i57j69i60l4j69i59.1286j0j4" +
    "&sourceid=chrome" +
    "&ie=UTF-8")

@shyiko
Copy link
Collaborator

shyiko commented Nov 28, 2017

Alright, KDoc fix included in ktlint@0.13.0. Let me know if you disagree with loadUrl... part.

@shyiko shyiko closed this as completed Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants