-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Run Checkstyle with gradle to make it easier for users - No longer needs different configuration for new code - Exclude current violations - Fix some violations that somehow couldn't be specified in the exclusion file - Print SpotBugs/Lint/Checkstly violations in GitHub format - Then the CI run gets annotated on the web UI
- Loading branch information
1 parent
fc40da2
commit e578f4c
Showing
44 changed files
with
501 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/python | ||
from xml.dom import minidom | ||
import os.path | ||
import glob | ||
from pathlib import Path | ||
|
||
if os.path.isfile('app/build/reports/lint-results-playDebug.xml'): | ||
dom = minidom.parse('app/build/reports/lint-results-playDebug.xml') | ||
issues = dom.getElementsByTagName('issue') | ||
for issue in issues: | ||
locations = issue.getElementsByTagName('location') | ||
for location in locations: | ||
print(location.attributes['file'].value + ":" + location.attributes['line'].value + " " + issue.attributes['summary'].value) | ||
print("::error file=" + location.attributes['file'].value | ||
+ ",line=" + location.attributes['line'].value | ||
+ ",endLine=" + location.attributes['line'].value | ||
+ ",title=Lint::" + issue.attributes['summary'].value + ". " + issue.attributes['explanation'].value.replace('\n', ' ')) | ||
print() | ||
|
||
if os.path.isfile('build/reports/checkstyle/checkstyle.xml'): | ||
dom = minidom.parse('build/reports/checkstyle/checkstyle.xml') | ||
files = dom.getElementsByTagName('file') | ||
for f in files: | ||
errors = f.getElementsByTagName('error') | ||
for error in errors: | ||
print(f.attributes['name'].value + ":" + error.attributes['line'].value + " " + error.attributes['message'].value) | ||
print("::error file=" + f.attributes['name'].value | ||
+ ",line=" + error.attributes['line'].value | ||
+ ",endLine=" + error.attributes['line'].value | ||
+ ",title=Checkstyle::" + error.attributes['message'].value) | ||
print() | ||
|
||
|
||
for filename in glob.iglob('**/build/reports/spotbugs/*.xml', recursive=True): | ||
filenamePath = Path(filename) | ||
dom = minidom.parse(filename) | ||
instance = dom.getElementsByTagName('BugInstance') | ||
for inst in instance: | ||
lines = inst.getElementsByTagName('SourceLine') | ||
longMessage = inst.getElementsByTagName('LongMessage')[0].firstChild.nodeValue | ||
for line in lines: | ||
if "primary" in line.attributes: | ||
print(line.attributes['sourcepath'].value + ": " + longMessage) | ||
print("::error file=" + str(filenamePath.parent.parent.parent.parent.absolute()) + "/src/main/java/" + line.attributes['sourcepath'].value | ||
+ ",line=" + line.attributes['start'].value | ||
+ ",endLine=" + line.attributes['end'].value | ||
+ ",title=SpotBugs::" + longMessage.replace('\n', ' ')) | ||
print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
|
||
<Button | ||
android:id="@+id/btn_open_bug_tracker" | ||
android:text="@string/open_bug_tracker" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"/> | ||
android:id="@+id/btn_open_bug_tracker" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/open_bug_tracker" /> | ||
|
||
<Button | ||
android:id="@+id/btn_copy_log" | ||
android:text="@string/copy_to_clipboard" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"/> | ||
android:id="@+id/btn_copy_log" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/copy_to_clipboard" /> | ||
|
||
<TextView | ||
android:layout_marginTop="8dp" | ||
android:id="@+id/crash_report_logs" | ||
android:textIsSelectable="true" | ||
android:textSize="12sp" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1"/> | ||
android:id="@+id/crash_report_logs" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_marginTop="8dp" | ||
android:textIsSelectable="true" | ||
android:textSize="12sp" | ||
android:layout_weight="1" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:paddingLeft="16dp" | ||
android:paddingRight="16dp" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="8dp"> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:paddingLeft="16dp" | ||
android:paddingRight="16dp" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="8dp"> | ||
|
||
<CheckBox | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/checkbox_do_not_show_again" | ||
android:text="@string/checkbox_do_not_show_again"/> | ||
android:id="@+id/checkbox_do_not_show_again" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/checkbox_do_not_show_again" /> | ||
|
||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
|
||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:inputType="text" | ||
android:ems="10" | ||
android:id="@+id/urlEditText" /> | ||
android:id="@+id/urlEditText" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:inputType="text" | ||
android:ems="10" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.