Closed Bug 1964352 Opened 1 year ago Closed 1 year ago

Enable some of the disabled new rules after ktlint 1.5.0 upgrade.

Categories

(Firefox for Android :: General, task)

All
Android
task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: mcarare, Assigned: mcarare)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group6] )

Attachments

(10 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

We recently upgraded to ktlint version 1.5.0, which introduced some new linting rules. Due to the potential for widespread changes, we initially disabled these new rules in our .editorconfig files.

This issue tracks the work to review and enable a subset of the previously disabled ktlint rules.

Kotlin style guide: Consistent spacing around colon.

Kotlin style guide: No new line before parameter type.

Kotlin style guide: Consistent spacing in try { .. } catch { .. } finally { .. }.

Kotlin style guide: Constant names use UPPER_SNAKE_CASE, Non-constant names are written in camelCase.

Also disable the rule for Composables.

Kotlin style guide: No newline expected before parameter.

Kotlin style guide: No empty parentheses are needed before trailing lambda.

Kotlin style guide:
Braces are not required for if expressions which have no more than one else branch and which fit on a single line.
When braces are kept for better readability, block should be placed after a new line.

Kotlin style guide: Wildcard imports (of any type) are not allowed.
Also remove exception from detekt for java.util package.

Replace single line block comments with EOL comments

Also remove extra blank lines in editorconfig files.

Attachment #9486420 - Attachment is obsolete: true
Pushed by mcarare@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e7664711c1f7 Enable standard:colon-spacing ktlint rule and fix errors. r=android-reviewers,nalexander
Pushed by mcarare@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b703012d6a24 Enable standard:parameter-list-spacing ktlint rule and fix errors. r=geckoview-reviewers,android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/356d1ddfca4d Enable standard:try-catch-finally-spacing ktlint rule and fix errors. r=android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/e0d52ca653cb Enable standard:property-naming ktlint rule and fix errors. r=android-reviewers,nalexander,pollymce https://hg.mozilla.org/integration/autoland/rev/369aea30d300 Enable standard:function-naming ktlint rule and fix errors. r=android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/e69ea3203ec1 Enable standard:function-literal rule and fix errors. r=android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/653c42a0da90 Enable standard:unnecessary-parentheses-before-trailing-lambda rule and fix errors. r=android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/dce5415cb092 Enable standard:no-wildcard-imports rule and fix errors. r=android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/8c17555e31e2 Enable standard:no-single-line-block-comment rule. r=android-reviewers,nalexander https://hg.mozilla.org/integration/autoland/rev/ca73b3cb2304 Remove duplicate entry for ktlint_standard_no-empty-first-line-in-class-body r=android-reviewers,nalexander
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: