summaryrefslogtreecommitdiffstats
path: root/tools/apilint
Commit message (Collapse)AuthorAgeFilesLines
* Relax apilint FW1 error to a warningAdam Powell2015-04-101-1/+1
| | | | | | | | This rule was catching simple getters ("getIntent") as errors even if the method is a true property get method. Relax to warning until we can make this a bit more clever. Change-Id: If183ad5bdc076ce2252399d4abcc8a3a6cbb55c3
* Add support for GmsCore to apilint.pyAdam Metcalf2015-03-271-7/+29
| | | | | | | Add flag to allow references to google. Refactor argument parsing to use argparse. Change-Id: I5fd3b6628a00113b9644dcae2919632db056909d
* Relax Handler lint check slightly.Jeff Sharkey2015-02-251-27/+23
| | | | | | This way we avoid yelling at support library APIs. Change-Id: I20bab887fe8b1c7f4d197273ddedbcda48c5a429
* Switch to incremental API parsing.Jeff Sharkey2015-02-221-63/+76
| | | | | | | | Incremental API parsing works on a single class at a time, which greatly reduces memory pressure. For example, linting a typical current.txt would use ~100MB before; now it only uses about ~15MB! Change-Id: Id084b3dd2f6513d0e919790d5a5d629f80637ce8
* Even more lint tests.Jeff Sharkey2015-02-181-47/+103
| | | | | | | | | | | | | | Updated boolean set/get tests to handle isFoo() and hasFoo() style methods. When listeners are passed as method argument, they should come near the end of the argument list. Verify that resources are named consistently. Slightly clearer message wording overall. Change-Id: Id22947bd932d82222ce3e6c6e2012dade348fb56
* More lint tests.Jeff Sharkey2015-02-171-6/+118
| | | | | | | | | | | | | | When overloading methods, verify that common arguments always come first and have consistent ordering. When methods register listeners or callbacks (outside of the UI toolkit), verify that an overload exists that takes a Handler to deliver events through. When a method accepts a Context argument, it must be the first argument. Change-Id: I6a6f94a3a0a8c48987835e47eb87564e569db2af
* Reference lint rule numbers, more rules.Jeff Sharkey2015-02-141-79/+162
| | | | | | | | When reporting lint errors/warnings, reference the relevant underlying rule. Also adds a few more lint rules, and removes a few aggressive checks. Change-Id: I1bdadf5fd4df9cd28bb7dfe1c7bb1f9055398315
* Track line numbers in lint script.Jeff Sharkey2015-02-121-58/+91
| | | | | | | | Also create separate class to describe failures, which can be consumed by other tools. Still offers to render itself for console output by default. Change-Id: Ib0555cc289ae08a0e446489509cc964c866c564e
* Catch incompatible API regressions.Jeff Sharkey2014-09-041-6/+88
| | | | | | | | Ignore deprecation, synchronized, and throws definitions. Look through full inheritance hierarchy to catch refactored classes like BaseBundle. Change-Id: I10ab0b4a0ef64e7508f38d0c223f08711293d643
* Add blame to API lint, some exemptions.Jeff Sharkey2014-09-041-77/+186
| | | | | | | | | | Now offers to parse the output of git blame, and includes the last person to modify that API for each reported failure. Add more exemptions, and check for boolean setFoo() method inside a separate Builder inner class. Change-Id: Id32dcbd5edf17d2360e4f782110bc1c445f7936e
* More API lint checks.Jeff Sharkey2014-08-291-5/+71
| | | | | | | | | | | When offering a helper Service, etc, all platform provided methods should be marked final. Otherwise, if available for developer to override, they should follow onFoo() style naming. Catch anyone returning concrete collections types, and look for overlapping flags. Change-Id: I29d95f3dff78a4da968a46f10be89eada509648c
* Teach API lint about package layering!Jeff Sharkey2014-08-281-1/+53
| | | | | | | Now it can identify layering violations, like when something deep in android.os depends on android.app. Change-Id: I94606c642195b3ed7558ff6979ed4a181cd85fa2
* Lint tool for current.txt.Jeff Sharkey2014-08-281-0/+488
Detects common public API mistakes, making it easy to quickly scan across all changes in a new API level. Builds in-memory representation of the current API, then runs various detectors over the classes. It collects failures, and can ignore known failures from a previous API level. Example usage: $ python frameworks/base/tools/apilint/apilint.py \ frameworks/base/api/current.txt \ prebuilts/sdk/api/21.txt Change-Id: Ie1f88894baf9f79e4b11e78c47f848ea5e25fc25