Add a Fenix and AC Linter to run ktlintFormat and detekt
Categories
(Fenix :: Tooling, task)
Tracking
(firefox131 fixed)
Tracking | Status | |
---|---|---|
firefox131 | --- | fixed |
People
(Reporter: olivia, Assigned: adhingra)
References
(Blocks 1 open bug)
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•5 months ago
|
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 1•5 months ago
|
||
Assignee | ||
Comment 2•5 months ago
|
||
Updated•5 months ago
|
Updated•5 months ago
|
Assignee | ||
Comment 3•5 months ago
|
||
Updated•5 months ago
|
Assignee | ||
Comment 4•4 months 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.py
used 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 lint
is 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_format
andac_format
are called from payload field in android-{ac|fenix}.yml. This is the main file which handles running./gradlew ktlint detekt
and reading/reporting the errors in the format that reviewbot reads it.
An example of how reviewbot will report errors is this patch.
Updated•4 months ago
|
Comment 6•3 months ago
|
||
bugherder |
Assignee | ||
Comment 8•3 months ago
|
||
Comment 9•3 months 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•3 months ago
|
||
Comment 11•3 months ago
|
||
Comment 12•3 months ago
|
||
bugherder |
Updated•2 months ago
|
Updated•2 months ago
|
Description
•