Add a Fenix and AC Linter to run ktlintFormat and detekt
Categories
(Firefox for Android :: Tooling, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox131 | --- | fixed |
People
(Reporter: olivia, Assigned: adhingra)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files, 3 obsolete files)
(Adding this bug as a stepping stone for bug 1891723.)
This bug is to add a linter that runs ./gradlew ktlintFormat detekt .
Right now to run the core AC/Fenix lints, the developer must CD into .../mobile/android/fenix or .../mobile/android/android-components and run ./gradlew ktlintFormat and ./gradlew detekt.
Consider creating:
./mach lint android-ac
./mach lint android-fenix
./mach lint firefox-android (Runs both AC and Fenix lints -> basing naming idea from preset that runs AC and Fenix)
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Comment 2•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
|
||
Just a bit of explanation on the edits made here to make reviewing easy
- build.gradle: To generate ktlint json reports. Detekt already used to generate reports and
lints.pyused to read reports created by spotless (GV lints). I used the same idea here, first to read the existing detekt reports, then realized that ktlint didnt generate reports by default so made changes to this file to generate ktlint json reports and read those too in lints.py. - mozlint-android.yml: This is so that when
./mach lintis ran, it runs the new linters too - android-{ac|fenix}.yml: These are the linter configurations. Based on documentation from https://firefox-source-docs.mozilla.org/code-quality/lint/create.html and android-format.yml as reference.
- lints.py: The new methods here
fenix_formatandac_formatare called from payload field in android-{ac|fenix}.yml. This is the main file which handles running./gradlew ktlint detektand reading/reporting the errors in the format that reviewbot reads it.
An example of how reviewbot will report errors is this patch.
Updated•1 year ago
|
Comment 6•1 year ago
|
||
| bugherder | ||
| Assignee | ||
Comment 8•1 year ago
|
||
Comment 9•1 year ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
| Assignee | ||
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•9 months ago
|
Description
•