Commit Graph

10 Commits

Author SHA1 Message Date
Aurimas Liutikas
fc518c714c Do not warn about uncommited files if sha is set explicitly.
Bug: 31603810
Test: Added test_GetModifiedFilesUncommittedExplicitCommit, all tests pass
Change-Id: I953f22df5be8030fc8a7145531026220c97a8dd8
2016-09-20 10:23:34 -07:00
Aurimas Liutikas
0b77686215 Allow missing method Javadocs for test classes in Checkstyle.
Bug: None
Test: Existing test_ShouldSkip will test this as it is using
      checkstyle.SKIPPED_RULES_FOR_TEST_FILES

Change-Id: I56c8c86a36f93b6b72a87fd97b75e5233fde9077
2016-09-20 10:19:48 -07:00
Maurice Lam
d513a1723f Add custom config XML support for checkstyle
Change-Id: If94dd073d7270d8fcdcf4f3041770712a193ce9e
2016-03-16 14:53:15 -07:00
Mitchell Wills
e524e6070b Add OuterTypeFilename rule to Checkstyle
This also requires modifying the logic to create temporary files so that
the filename is the same as that in source tree.

Bug: 27109166
Change-Id: I73f2406d5c85d45b0b259f0fd7dd081e44df029c
2016-02-11 16:59:56 -08:00
Aurimas Liutikas
99451e5b13 Skip JavaDoc checks for Java tests classes
Bug: 26862656
Change-Id: I708ee552154796ece6655db8f9f3157a2e9f3ba5
2016-01-29 13:10:01 -08:00
Aurimas Liutikas
2d59cfb992 Add support for running Checkstyle on a given SHA-1.
Usage e.g.: ./checkstyle.py -s 3aca02ca91816a86febb5ed6e380ec2122adea47

Additionally this CL adds a pre-push script that can be used a git
hook to run Checkstyle on 'repo upload'

Bug: 25852971
Change-Id: Ia00d48df80b2b024de0899d9590868016c5b7bf0
2016-01-25 17:16:28 -08:00
Aurimas Liutikas
a0e889762d Checkstyle handling when all lines are deleted.
It is valid to have empty modified_lines list for files
that only contain deletions. In such case we should skip
all the errors except for forced rules.

Updated the test to match the expectation.

Change-Id: I6993968b882fb6fbe2ba1f63f3b6879c3308ff34
2016-01-21 14:43:12 -08:00
Aurimas Liutikas
6b82b75c69 Allow to run checkstyle with untracked files present.
Additionally, this CL adds basic tests.

Bug: 25852971

Change-Id: Ia8a62e0d49428e1d933d2cef832c977e62f9c614
(cherry picked from commit 55e7480eff)
2015-12-18 00:54:02 +00:00
Aurimas Liutikas
4e8bad8045 Fix a crash when a brand new file is added.
Checkstyle.py was not handling additions of new files resulting in
a crash. For new files git.modified_lines() returns None. Added code
handles that case.

Bug: 25852971
Change-Id: I91e2b8c92581ec9e89bcbbcd2d274f56c791f3a9
(cherry picked from commit 5b87dbad0c)
2015-12-18 00:53:20 +00:00
Aurimas Liutikas
1fc79c2192 Add a script that allows developers to run checkstyle.
Allow developers to run Java style check in two ways.

Specific file:
checkstyle.py -f path/to/file/View.java

Lines modified in the latest commit:
checkstyle.py

Review moved from https://googleplex-android-review.googlesource.com/#/c/818813/
due to move from packages/experimental to development/tools

Bug: 25852971
Change-Id: Ibcf9d80644f2938828b21e8f50ab0d6f39c286b0
(cherry picked from commit 96f27d0960)
2015-12-18 00:52:35 +00:00