-
Notifications
You must be signed in to change notification settings - Fork 6
Pass merged manifest to Android Lint #23
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
Open
arunkumar9t2
wants to merge
6
commits into
Bencodes:main
Choose a base branch
from
arunkumar9t2:arun/pass-merged-manifest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c091f6b
Pass merged manifest to Android Lint
arunkumar9t2 453d924
Fix failing tests
arunkumar9t2 aca4118
Set API level for NDK
arunkumar9t2 1d0c4f2
Fix buildifier
arunkumar9t2 3b7b716
Update examples and fix tests
arunkumar9t2 7cb874a
Use manifest file as-is
arunkumar9t2 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 hidden or 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,7 +1,13 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="com.rules.android.lint.examples"> | ||
| package="com.rules.android.lint"> | ||
|
|
||
| <uses-sdk android:minSdkVersion="23"/> | ||
| <uses-sdk android:minSdkVersion="23" /> | ||
|
|
||
| <application> | ||
| <activity | ||
| android:name=".TestActivity" | ||
| android:exported="true" /> | ||
| </application> | ||
|
|
||
| </manifest> |
This file contains hidden or 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 hidden or 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,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="com.rules.android.lint.examples"> | ||
|
|
||
| <uses-sdk android:minSdkVersion="1" | ||
| android:targetSdkVersion="1" /> | ||
| </manifest> |
This file contains hidden or 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,7 @@ | ||
| package com.rules.android.lint; | ||
|
|
||
| import android.app.Activity; | ||
|
|
||
| public class TestActivity extends Activity { | ||
|
|
||
| } |
This file contains hidden or 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 +1,6 @@ | ||
| android_sdk_repository(name = "androidsdk") | ||
|
|
||
| android_ndk_repository( | ||
| name = "androidndk", | ||
| api_level = 30, | ||
| ) |
This file contains hidden or 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,15 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <issues format="6" by="lint 8.3.0-alpha09" type="baseline" client="" dependencies="false" name="" variant="all" version="8.3.0-alpha09"> | ||
|
|
||
| <issue | ||
| id="DefaultLocale" | ||
| message="Implicitly using the default locale is a common source of bugs: Use `toUpperCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`." | ||
| errorLine1=" System.out.println("WRONG".toUpperCase());" | ||
| errorLine2=" ~~~~~~~~~~~"> | ||
| <location | ||
| file="Foo.java" | ||
| line="6" | ||
| column="32"/> | ||
| </issue> | ||
|
|
||
| </issues>s |
This file contains hidden or 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,22 +1,15 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <issues format="6" by="lint 8.3.0-alpha09"> | ||
| <issues format="6" by="lint 8.3.0-alpha09" type="baseline" client="" dependencies="false" name="" variant="all" version="8.3.0-alpha09"> | ||
|
|
||
| <issue | ||
| id="DefaultLocale" | ||
| severity="Error" | ||
| message="Implicitly using the default locale is a common source of bugs: Use `toUpperCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`." | ||
| category="Correctness" | ||
| priority="6" | ||
| summary="Implied default locale in case conversion" | ||
| explanation="Calling `String#toLowerCase()` or `#toUpperCase()` **without specifying an explicit locale** is a common source of bugs. The reason for that is that those methods will use the current locale on the user's device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for `i` is **not** `I`.

If you want the methods to just perform ASCII replacement, for example to convert an enum name, call `String#toUpperCase(Locale.US)` instead. If you really want to use the current locale, call `String#toUpperCase(Locale.getDefault())` instead." | ||
| url="https://developer.android.com/reference/java/util/Locale.html#default_locale" | ||
| urls="https://developer.android.com/reference/java/util/Locale.html#default_locale" | ||
| errorLine1=" System.out.println("WRONG".toUpperCase());" | ||
| errorLine2=" ~~~~~~~~~~~"> | ||
| id="ExpiredTargetSdkVersion" | ||
| message="Google Play requires that apps target API level 33 or higher." | ||
| errorLine1=" android:targetSdkVersion="1" />" | ||
| errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> | ||
| <location | ||
| file="Foo.java" | ||
| file="LibManifest.xml" | ||
| line="6" | ||
| column="32"/> | ||
| column="9"/> | ||
| </issue> | ||
|
|
||
| </issues> | ||
| </issues> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Lint does seem to work when we pass the file as-is - here it is passed as
LibManifest.xmland baseline does report issues. Please let me know if there is any case I missed.