-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge some of the WordPress lint rules, to reduce number of reported issues #21256
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e210382
temp: use wip version of wordpress lint checks
wzieba 47bae6b
Revert "temp: use wip version of wordpress lint checks"
wzieba 53af796
Merge branch 'trunk' into bump_android_lint
wzieba 3f5fa72
Don't enable `UnknownNullness` lint warning
wzieba 2d61b81
Merge branch 'trunk' into bump_android_lint
wzieba 20cd7bd
Disable disabling `UseTomlInstead` in `login` module
wzieba 543395f
Merge branch 'trunk' into bump_android_lint
wzieba 32b261d
Use version catalog for dependencies that specify artifact type
wzieba d89ed5e
Remove `UseTomlInstead` from disabled lint rules
wzieba 94773c7
Remove `IgnoreWithoutReason` from disabled lint rules
wzieba ffb9840
Merge branch 'trunk' into bump_android_lint
wzieba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -30,7 +30,6 @@ android { | |
} | ||
|
||
lint { | ||
enable += 'UnknownNullness' | ||
disable 'UseTomlInstead', 'IgnoreWithoutReason' | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -29,10 +29,6 @@ android { | |
} | ||
} | ||
|
||
lint { | ||
enable += 'UnknownNullness' | ||
} | ||
|
||
buildFeatures { | ||
viewBinding true | ||
} | ||
|
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 |
---|---|---|
|
@@ -18,7 +18,6 @@ android { | |
buildConfig true | ||
} | ||
lint { | ||
enable += 'UnknownNullness' | ||
disable 'UseTomlInstead' | ||
} | ||
} | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion (💡): I understand that we could remove this here too, now that all dependencies within this module are migrated to version catalogs. And then get rid of the whole
lint { ... }
block, just like you did for the rest of the modules.PS: We could potentially do the same for the
fluxc
module, but we would first need to migrate the below two dependencies to version catalogs (however, I am not sure about theIgnoreWithoutReason
):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not easy to do though, because of the aar specification not working as intended. This is needed, because both of these dependencies offer both
aar
andjar
and one of them even defaults tojar
. This seems to be a known issue at Gradle (gradle/gradle#21267) but not yet fixed.But regarding the
login
module, I agree, I'll fix this in a sec!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wzieba ! 🙏
Yea, true, I tried really quick myself and couldn't get it working (the right way), but I didn't thought this would be such a blocker, interesting, thanks for sharing this issue... 🤔
I guess, in the meanwhile, we could do the following, adding a TODO comment point to the issue you shared:
libs.version.toml
build.gradle
Wdyt? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks neat, but I'm unable to verify that
aar
instead ofjar
is actually used.Let's take the JNA dependency for the example: it offers both
aar
andjar
. The default artifact specified in the pom file isjar
: https://mvnrepository.com/artifact/net.java.dev.jna/jna/5.15.0When I applied your suggestion and when I run
:WordPress:dependencyInsight --dependency net.java.dev.jna:jna --configuration wordpressWasabiDebugRuntimeClasspath
, it seems thatjar
is used. You can compare this result to result of any other dependency, e.g.:WordPress:dependencyInsight --dependency androidx.credentials:credentials --configuration wordpressWasabiDebugRuntimeClasspath
which prints usage ofaar
.But what's strange, when I run the dependency insight for JNA on
trunk
, I also see thatjar
is requested 😕 .For this reason, as I'm not entirely sure how it all work, I'd postpone changing this dependencies to version catalog as I'm not sure what would be the effect. Happy to hear your thoughts - maybe there's a way to make sure
aar
is used?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wzieba , I did a simple
println(...)
to verify the exact string that is used. In the end, using this.get().toString()
trick should give us exactly what we had before, a simple string, there shouldn't be any more magic involved, not having version catalogs choosing betweenaar
andjar
whatsoever (🤔). This is my assumption at least. 🤞There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha 👍 when I removed
@aar
the project won't compile, and with the code you suggested, build is complete so I think we're all good 👍I've also applied changed to remove
IgnoreWithoutReason
from disabled rules.