Fix some codacy warnings
- Quote some strings in analysis-wrapper - Cleanup unneeded checks in spotbugs-up Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
3879d90eec
commit
6eff01d735
@ -15,7 +15,7 @@ ruby scripts/analysis/lint-up.rb $1 $2 $3
|
|||||||
lintValue=$?
|
lintValue=$?
|
||||||
|
|
||||||
curl 2>/dev/null "https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.xml" -o "/tmp/$stableBranch.xml"
|
curl 2>/dev/null "https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.xml" -o "/tmp/$stableBranch.xml"
|
||||||
ruby scripts/analysis/spotbugs-up.rb $3
|
ruby scripts/analysis/spotbugs-up.rb "$3"
|
||||||
spotbugsValue=$?
|
spotbugsValue=$?
|
||||||
|
|
||||||
# exit codes:
|
# exit codes:
|
||||||
@ -28,7 +28,7 @@ echo "Branch: $3"
|
|||||||
if [ $3 = $stableBranch ]; then
|
if [ $3 = $stableBranch ]; then
|
||||||
echo "New spotbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
|
echo "New spotbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
|
||||||
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
||||||
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.xml --upload-file app/build/reports/spotbugs/gplayDebug.xml
|
curl 2>/dev/null -u "$4:$5" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.xml" --upload-file app/build/reports/spotbugs/gplayDebug.xml
|
||||||
|
|
||||||
if [ $lintValue -ne 1 ]; then
|
if [ $lintValue -ne 1 ]; then
|
||||||
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
|
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
|
||||||
@ -131,7 +131,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
payload="{ \"body\" : \"$codacyResult $lintResult $spotbugsResult $checkLibraryMessage $lintMessage $spotbugsMessage $gplayLimitation $notNull\" }"
|
payload="{ \"body\" : \"$codacyResult $lintResult $spotbugsResult $checkLibraryMessage $lintMessage $spotbugsMessage $gplayLimitation $notNull\" }"
|
||||||
curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "$payload"
|
curl -u "$1:$2" -X POST "https://api.github.com/repos/nextcloud/android/issues/$7/comments" -d "$payload"
|
||||||
|
|
||||||
if [ ! -z "$gplayLimitation" ]; then
|
if [ ! -z "$gplayLimitation" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -9,16 +9,6 @@ puts "=================== starting Android Spotbugs Entropy Reducer ============
|
|||||||
# get args
|
# get args
|
||||||
git_branch = ARGV[0]
|
git_branch = ARGV[0]
|
||||||
|
|
||||||
# ======================== SETUP ============================
|
|
||||||
|
|
||||||
# File name and relative path of generated Spotbugs report. Must match build.gradle file:
|
|
||||||
# lintOptions {
|
|
||||||
# htmlOutput file("[FILE_NAME].html")
|
|
||||||
# }
|
|
||||||
SPOTBUGS_REPORT_FILE = String.new("app/build/reports/spotbugs/spotbugs.html")
|
|
||||||
|
|
||||||
# ================ SETUP DONE; DON'T TOUCH ANYTHING BELOW ================
|
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
require 'open3'
|
require 'open3'
|
||||||
@ -27,14 +17,6 @@ require 'open3'
|
|||||||
puts "running Spotbugs..."
|
puts "running Spotbugs..."
|
||||||
system './gradlew spotbugsGplayDebug 1>/dev/null 2>&1'
|
system './gradlew spotbugsGplayDebug 1>/dev/null 2>&1'
|
||||||
|
|
||||||
# find Spotbugs report file
|
|
||||||
spotbugs_reports = Dir.glob(SPOTBUGS_REPORT_FILE)
|
|
||||||
if spotbugs_reports.length == 0
|
|
||||||
puts "Spotbugs HTML report not found."
|
|
||||||
exit 1
|
|
||||||
end
|
|
||||||
spotbugs_report = String.new(spotbugs_reports[0])
|
|
||||||
|
|
||||||
# find number of warnings
|
# find number of warnings
|
||||||
current_warning_count = `./scripts/analysis/spotbugsSummary.py --total`.to_i
|
current_warning_count = `./scripts/analysis/spotbugsSummary.py --total`.to_i
|
||||||
puts "found warnings: " + current_warning_count.to_s
|
puts "found warnings: " + current_warning_count.to_s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user