Skip to content

Conversation

@AlvaroBrey
Copy link
Member

@AlvaroBrey AlvaroBrey commented Jul 4, 2022

  • build: Replace ktlint plugin with spotless
  • Fix pre-commit hook to use spotless
  • Fix git hooks copy logic
  • Update check workflow to use spotless
  • Auto-fix ktlint format issues

Fixes #929

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

SpotBugs (new)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 41
Total 151

SpotBugs (master)

Warning Type Number
Bad practice Warnings 17
Correctness Warnings 36
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 13
Security Warnings 1
Dodgy code Warnings 45
Total 164

@AlvaroBrey AlvaroBrey marked this pull request as draft July 4, 2022 10:33
@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #932 (5381d08) into master (72ca650) will decrease coverage by 0.01%.
The diff coverage is 36.36%.

@@            Coverage Diff             @@
##           master     #932      +/-   ##
==========================================
- Coverage   48.75%   48.73%   -0.02%     
==========================================
  Files         171      171              
  Lines        6609     6611       +2     
  Branches      881      881              
==========================================
  Hits         3222     3222              
- Misses       2919     2921       +2     
  Partials      468      468              
Impacted Files Coverage Δ
...b/resources/files/ToggleFileLockRemoteOperation.kt 55.55% <ø> (ø)
...b/resources/profile/GetHoverCardRemoteOperation.kt 62.50% <0.00%> (-2.72%) ⬇️
...es/search/UnifiedSearchProvidersRemoteOperation.kt 48.14% <0.00%> (-1.86%) ⬇️
...ary/src/main/java/com/nextcloud/common/DNSCache.kt 80.95% <ø> (ø)
...ain/java/com/owncloud/android/lib/common/Editor.kt 42.85% <0.00%> (ø)
...n/java/com/owncloud/android/lib/common/Template.kt 33.33% <0.00%> (ø)
...n/java/com/owncloud/android/lib/common/UserInfo.kt 57.14% <0.00%> (ø)
.../main/java/com/nextcloud/common/NextcloudClient.kt 57.14% <100.00%> (ø)
...va/com/owncloud/android/lib/common/ExternalLink.kt 100.00% <100.00%> (ø)
...main/java/com/owncloud/android/lib/common/Quota.kt 88.88% <100.00%> (ø)
... and 1 more

@AlvaroBrey AlvaroBrey marked this pull request as ready for review July 4, 2022 10:49
@AlvaroBrey AlvaroBrey marked this pull request as draft July 4, 2022 13:24
@AlvaroBrey
Copy link
Member Author

Note to self: try Spotless instead. Seems to be widely used and may not need gradle 7.3

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Was copying into the wrong folder, also doesn't belong in the library subproject

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
@AlvaroBrey AlvaroBrey force-pushed the ktlint-plugin-switch branch from bc657bc to ba1a9f8 Compare August 10, 2022 09:58
@AlvaroBrey AlvaroBrey marked this pull request as ready for review August 10, 2022 09:59
@github-actions
Copy link
Contributor

SpotBugs (new)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 39
Total 149

SpotBugs (master)

Warning Type Number
Bad practice Warnings 17
Correctness Warnings 36
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 13
Security Warnings 1
Dodgy code Warnings 45
Total 164

@AlvaroBrey
Copy link
Member Author

Spotless also can handle formatting for Markdown, Java, Groovy, XML, etc. We can later think about moving this to android-config and using it in all repos instead of individual formatting configurations

tobiasKaminsky
tobiasKaminsky previously approved these changes Aug 15, 2022
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@github-actions
Copy link
Contributor

SpotBugs (new)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 39
Total 149

SpotBugs (master)

Warning Type Number
Bad practice Warnings 17
Correctness Warnings 36
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 13
Security Warnings 1
Dodgy code Warnings 45
Total 164

@tobiasKaminsky
Copy link
Member

@AlvaroBrey do you have an idea why codecov is so low? 36% compared to 48%?

@AlvaroBrey
Copy link
Member Author

@AlvaroBrey do you have an idea why codecov is so low? 36% compared to 48%?

Coverage is still 48.73% (https://app.codecov.io/gh/nextcloud/android-library/compare/932?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr%20comments&utm_term=nextcloud)

36% is the coverage of the diff i.e. only the changes in this PR. Looks like we have it configured to fail if the diff coverage is lower than the project coverage, which makes sense.

@tobiasKaminsky tobiasKaminsky merged commit d8b07e6 into master Aug 18, 2022
@delete-merged-branch delete-merged-branch bot deleted the ktlint-plugin-switch branch August 18, 2022 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ktlint not working for sources outside the default package

3 participants