diff options
author | Tor Norbye <tnorbye@google.com> | 2011-11-07 13:06:47 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-11-07 15:41:15 -0800 |
commit | 229581314076be1b6f82fe1efed2bd00da340899 (patch) | |
tree | 314a105ea775b57795b97bff21732fc1cd8d5151 /anttasks | |
parent | 76ea268f11582c270ac42ec1441ae034187c2b6f (diff) | |
download | sdk-229581314076be1b6f82fe1efed2bd00da340899.zip sdk-229581314076be1b6f82fe1efed2bd00da340899.tar.gz sdk-229581314076be1b6f82fe1efed2bd00da340899.tar.bz2 |
Lint Architecture Changes: Configurations, Categories, etc.
This changeset makes various architectural changes to lint:
(1) Add configurations, which are basically user preferences for lint
in a given project, such as providing a custom severity for an
issue, or disabling a specific warning in a specific file.
In Eclipse, there is a project configuration (stored in lint.xml
in each project), as well as a global configuration (stored using
Eclipse preference data). Project configurations inherit from the
global configuration.
The options dialog now shows up both as a project property page
(showing the issue state for the project configuration), as well
as a normal preference page (showing the global or "fallback"
configuraiton). I also changed the Options UI for issues from a
Table to a TreeViewer to add in category nodes, and changed the
checkbox UI to have a custom severity toggle instead.
The lint quickfixes also now have 3 suppression options:
* Ignore in this file
* Ignore in this project
* Disable check
(2) Change detectors to be registered by class and instantiated for
each lint run rather than having a fixed list of detectors get
reused over and over. Turns out that since some detectors store
state, this prevented lints from running concurrently since the
two runs could stomp each other's state.
To do this effectively I've also switched from a DetectorRegistry
to an IssueRegistry, which contains the global list of available
issues and each issue can point to the class detecting the issue
(and these are created on the fly based on parameters like scope.)
(3) Explicit Categories. Categories used to just be a string property
on issues; now it's an explicit class with both a name and an
explanation, with parents to allow nesting (such that for example
the Usability category has an Icons sub category), and finally the
category class provides sorting. Categories also show up in the
HTML Report now as separate sections.
(4) Other API changes:
* I changed the package containing APIs for lint clients to an
explicit "client" package
* Moved the LintConstants class up from lint-checks to lint-api
and added a LintUtils class which contains many generic methods
that were spread around in specific detectors.
* The detectors are now talking to a wrapper client rather than
directly to lint clients, such that the wrapper client can
filter out results on disabled checks etc, which means that
tools can assume they always get correct reports and don't have
to worry about improperly written detectors.
* I renamed ToolContext to LintClient.
* I got rid of the "isEnabled" state, which was a bit redundant
with the severity since severity has a Severity.IGNORE value.
* I added a LintListener interface, which notifies about progress
(and the CLI tool will print "."'s for each processed file
unless suppressed with -q).
* A new dispose method on the parser interface to for example
allow IDEs to lock/unlock read models on underlying data.
(5) I added a toolbar action for running Lint on the currently
selected project. I also added an --xml export option intended
for use with CI plugins.
Change-Id: Icadd9b2d14d075234d97b31398806111af747b7b
Diffstat (limited to 'anttasks')
0 files changed, 0 insertions, 0 deletions