History log of /frameworks/base/tools/apilint/apilint.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
24bda1d6c82451cefb8eba50c5356089effb2c91 20-Apr-2017 Jeff Sharkey <jsharkey@android.com> Bunch of new API lint rules.

Test: manual verification
Fixes: 34709091
Fixes: 36699437
Fixes: 36737455
Fixes: 36737419
Fixes: 37279778
Fixes: 37283667
Fixes: 37473581
Fixes: 37505566
Fixes: 37509300
Change-Id: Ie5dbcc2932313225e5cbc1f4aa6961e4db2f3d45
/frameworks/base/tools/apilint/apilint.py
40d623e676daff9f60ad6ffa6c723a7640eece04 21-Dec-2016 Jeff Sharkey <jsharkey@android.com> Tighter equals/hashCode method checking.

Test: false-positive no longer triggered
Bug: 32721082
Change-Id: I49b6225a7282d0bb84b0dfb4cabe56e9f68186a9
/frameworks/base/tools/apilint/apilint.py
26c809064747d62a139f33c3c5124102cbba7e83 21-Dec-2016 Jeff Sharkey <jsharkey@android.com> Detect non-static abstract inner classes.

Test: script detects issue
Bug: 32982018
Change-Id: I4e3521bf603f6272bfe5583e3d4977dd5b59afe8
/frameworks/base/tools/apilint/apilint.py
db234ef0ac1d1a7fec7d1f00ba37bbd7435e9893 29-Nov-2016 Filip Pavlis <pavlis@google.com> Adds keyword "default" to the API-linter.

This will fix issue when linting Java 8 default methods on interfaces,
e.g. Ie46a876dcb14b46b8b2584735c106c25655ec6cf.

Test: Manualy tried that the linter no longer gives the error.

Change-Id: I68ade6ba6401439667408076a5454caef77ef72d
/frameworks/base/tools/apilint/apilint.py
70168dde6e1da06042818350fc6e258188d001ae 31-Mar-2016 Jeff Sharkey <jsharkey@android.com> Make Parcelable classes final, API cleanup.

Remove some Context methods that leaked through. Add lint rule to
recommend using List<? extends Parcelable> instead of Parcelable[].

Bug: 27932224, 27930145, 27932911
Change-Id: Ia302de46cdb0c5101fa175a09316df91aeefcf0d
/frameworks/base/tools/apilint/apilint.py
331279b239a6f5f392372f34cd6923fa589f9987 01-Mar-2016 Jeff Sharkey <jsharkey@android.com> More lint checks.

-- Error if Parcelable classes aren't final.
-- Warn that MIN_/MAX_ constants that should be dynamic.
-- Error if throwing raw RemoteException.
-- Warn if methods accept File without stream variants.
-- Ignore upstream ICU project.

Bug: 27410989
Change-Id: I12d843e63078dc696c1798a20e088608f1ba9ed1
/frameworks/base/tools/apilint/apilint.py
539ea12810f6373eed926d07b856ab76a8ae8355 10-Apr-2015 Adam Powell <adamp@google.com> Relax apilint FW1 error to a warning

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
/frameworks/base/tools/apilint/apilint.py
1c7e70aaf85576b6d63f98e19cc2356913e8cfac 28-Mar-2015 Adam Metcalf <gamblore@google.com> Add support for GmsCore to apilint.py

Add flag to allow references to google.
Refactor argument parsing to use argparse.

Change-Id: I5fd3b6628a00113b9644dcae2919632db056909d
/frameworks/base/tools/apilint/apilint.py
047d7f0c6ded6fb6b01a708070955647b7ff4ae7 25-Feb-2015 Jeff Sharkey <jsharkey@android.com> Relax Handler lint check slightly.

This way we avoid yelling at support library APIs.

Change-Id: I20bab887fe8b1c7f4d197273ddedbcda48c5a429
/frameworks/base/tools/apilint/apilint.py
a18a2e3428d73369be7ab1663792f0a080e037ca 23-Feb-2015 Jeff Sharkey <jsharkey@android.com> Switch to incremental API parsing.

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
/frameworks/base/tools/apilint/apilint.py
90b547bb50b3ceaa78e8832fa8daeea851802928 19-Feb-2015 Jeff Sharkey <jsharkey@android.com> Even more lint tests.

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
/frameworks/base/tools/apilint/apilint.py
b46a9690d54c677adeadb93e830da42c6a75f09c 18-Feb-2015 Jeff Sharkey <jsharkey@android.com> More lint tests.

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
/frameworks/base/tools/apilint/apilint.py
9f64d5c6c456863489ffb8583d611211e7c2f88f 15-Feb-2015 Jeff Sharkey <jsharkey@android.com> Reference lint rule numbers, more rules.

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
/frameworks/base/tools/apilint/apilint.py
ed6aaf0f79b7b39b2d70684c902d2d689a3db841 30-Jan-2015 Jeff Sharkey <jsharkey@android.com> Track line numbers in lint script.

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
/frameworks/base/tools/apilint/apilint.py
037458a5bac2968eb0415c408d68c013d177ea3e 05-Sep-2014 Jeff Sharkey <jsharkey@android.com> Catch incompatible API regressions.

Ignore deprecation, synchronized, and throws definitions. Look
through full inheritance hierarchy to catch refactored classes like
BaseBundle.

Change-Id: I10ab0b4a0ef64e7508f38d0c223f08711293d643
/frameworks/base/tools/apilint/apilint.py
1498f9c615395de17e11204b962d7d925e5f222d 04-Sep-2014 Jeff Sharkey <jsharkey@android.com> Add blame to API lint, some exemptions.

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
/frameworks/base/tools/apilint/apilint.py
294f0de15b510afc06a436bf7cd45d99512c71d3 30-Aug-2014 Jeff Sharkey <jsharkey@android.com> More API lint checks.

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
/frameworks/base/tools/apilint/apilint.py
932a07cefea64e858fc999da4be577b10b59fd9f 29-Aug-2014 Jeff Sharkey <jsharkey@android.com> Teach API lint about package layering!

Now it can identify layering violations, like when something deep in
android.os depends on android.app.

Change-Id: I94606c642195b3ed7558ff6979ed4a181cd85fa2
/frameworks/base/tools/apilint/apilint.py
8190f4885b3eb34231877003a583116a0e82826e 28-Aug-2014 Jeff Sharkey <jsharkey@android.com> Lint tool for current.txt.

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
/frameworks/base/tools/apilint/apilint.py