Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27473] Android: Replace clang Java formatter with gradle "checkstyle" tool

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2020-04-29T01:11:27.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.1.0
ComponentsAndroid
Labelsandroid, code, format, linting
ReporterJoshua Quick
AssigneeJoshua Quick
Created2019-10-16T01:23:12.000+0000
Updated2020-04-29T01:11:56.000+0000

Description

*Summary:* The Android gradle build system includes its own "checkstyle" tool. This tool is used to enforce Java coding standards and to check for common Java coding errors. It can be used to trigger build errors that fails to pass the configured rules defined in a "checkstyle.xml" file. https://docs.gradle.org/current/userguide/checkstyle_plugin.html https://checkstyle.org/index.html *To-Do:* We should replace our existing clang-format tool in favor of this gradle checkstyle tool. The main reason is because the dev team does not know they are violating the clang linter's rules until its been ran on Jenkins (or ran manually via node). * Jenkins is verifying the clang formatting rules by reformatting changed Java files and doing a comparison of files. This is too restrictive because the reformat of the files sometimes looks worse from a readability standpoint. (Too restrictive.) * The dev team sometimes doesn't know they are violating clang's rules until a PR has been submitted to Jenkins or we run it manually via node. (Common mistake.)

Comments

  1. Joshua Quick 2020-04-29

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/11516

JSON Source