Skip to content

Commit 382553d

Browse files
Change spotless call
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 8c785d7 commit 382553d

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

Diff for: scripts/analysis/analysis-wrapper.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ echo "Branch: $BRANCH"
2828

2929
if [ "$BRANCH" = $stableBranch ]; then
3030
echo "New spotbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
31-
curl -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file app/build/reports/spotbugs/spotbugs.html
32-
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.xml" --upload-file app/build/reports/spotbugs/gplayDebug.xml
31+
curl -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file core/build/reports/spotbugs/spotbugs.html
32+
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.xml" --upload-file core/build/reports/spotbugs/debug.xml
3333

3434
if [ $lintValue -ne 1 ]; then
3535
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
36-
curl -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/$stableBranch.html --upload-file app/build/reports/lint/lint.html
36+
curl -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/$stableBranch.html --upload-file core/build/reports/lint/lint.html
3737
exit 0
3838
fi
3939
else
4040
if [ -e "${BUILD_NUMBER}" ]; then
4141
6=$stableBranch"-"$(date +%F)
4242
fi
4343
echo "New lint results at https://www.kaminsky.me/nc-dev/$repository-lint/${BUILD_NUMBER}.html"
44-
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/${BUILD_NUMBER}.html" --upload-file app/build/reports/lint/lint.html
44+
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/${BUILD_NUMBER}.html" --upload-file core/build/reports/lint/lint.html
4545

4646
echo "New spotbugs results at https://www.kaminsky.me/nc-dev/$repository-findbugs/${BUILD_NUMBER}.html"
47-
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/${BUILD_NUMBER}.html" --upload-file app/build/reports/spotbugs/spotbugs.html
47+
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/${BUILD_NUMBER}.html" --upload-file core/build/reports/spotbugs/spotbugs.html
4848

4949
# delete all old comments, starting with Codacy
5050
oldComments=$(curl_gh -X GET "https://api.github.com/repos/nextcloud/$repository/issues/${PR_NUMBER}/comments" | jq '.[] | select((.user.login | contains("github-actions")) and (.body | test("<h1>Codacy.*"))) | .id')

Diff for: scripts/analysis/spotbugs-up.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
require 'open3'
1515

1616
# run Spotbugs
17-
puts "running Spotbugs..."
18-
system './gradlew spotbugsGplayDebug 1>/dev/null 2>&1'
17+
puts "running Spotless..."
18+
system './gradlew spotlessCheck 1>/dev/null 2>&1'
1919

2020
# find number of warnings
2121
current_warning_count = `./scripts/analysis/spotbugsSummary.py --total`.to_i

Diff for: scripts/analysis/spotbugsSummary.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def print_total(summary):
5151
parser = argparse.ArgumentParser()
5252
parser.add_argument("--total", help="print total count instead of summary HTML",
5353
action="store_true")
54-
parser.add_argument("--file", help="file to parse", default="app/build/reports/spotbugs/gplayDebug.xml")
54+
parser.add_argument("--file", help="file to parse", default="core/build/reports/spotbugs/debug.xml")
5555
args = parser.parse_args()
5656
tree = ET.parse(args.file)
5757
summary = get_counts(tree)

Diff for: scripts/lib.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Nextcloud Android Library is available under MIT license
4+
#
5+
# @author Álvaro Brey Vilas
6+
# Copyright (C) 2022 Álvaro Brey Vilas
7+
# Copyright (C) 2022 Nextcloud GmbH
8+
#
9+
# Permission is hereby granted, free of charge, to any person obtaining a copy
10+
# of this software and associated documentation files (the "Software"), to deal
11+
# in the Software without restriction, including without limitation the rights
12+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
# copies of the Software, and to permit persons to whom the Software is
14+
# furnished to do so, subject to the following conditions:
15+
#
16+
# The above copyright notice and this permission notice shall be included in
17+
# all copies or substantial portions of the Software.
18+
#
19+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23+
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24+
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26+
# THE SOFTWARE.
27+
#
28+
29+
## This file is intended to be sourced by other scripts
30+
31+
32+
function err() {
33+
echo >&2 "$@"
34+
}
35+
36+
37+
function curl_gh() {
38+
if [[ -n "$GITHUB_TOKEN" ]]
39+
then
40+
curl \
41+
--silent \
42+
--header "Authorization: token $GITHUB_TOKEN" \
43+
"$@"
44+
else
45+
err "WARNING: No GITHUB_TOKEN found. Skipping API call"
46+
fi
47+
48+
}

0 commit comments

Comments
 (0)