-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Add Android Linting Example #3931
Add Android Linting Example #3931
Conversation
@c0d33ngr looks good, need to include an example test and explanation so we can include it in the documentation |
@c0d33ngr Buddy you did just basic linting but this is not the appropriate way tbh i have tried this on my example and its saying the miss of class file but class files only come after the compilation so @lihaoyi i request you to please wait till my new pull request(anndroid bundle support) gets merged coz in that i have updated the whole android app building process and made it professional (now we can include custom resources) so @c0d33ngr sorry to interrupt you, but please understand... |
@himanshumahajan138 completing bounties out of order is fine. I'll look at your PR if you wish and we can decide which one to merge first |
Ya I Agree We can decide which one to merge first i was saying before becoz there will be need for updated code as you can see in my pr i have updated the codes with resources so that's the only thing i was concerned about rest we can decide this... |
@lihaoyi this command below produce the error output above. What could be wrong? |
@c0d33ngr the lint error should be fixed in latest main branch, if you merge in main it should work. Give me some time to do a proper review, I'm not familiar with android haha |
FYI I'm planning on landing #3935 first before coming back to this, since that one is a larger and more invasive PR so this one would be easier to rebase/merge after |
Took a review pass. Looks like a straightforward change but left a few nits |
I'll do the necessary changes and also include more features to it. I had to rewrite it as a module after looking through java linting in the codebase and also other android related modules |
I was ill so I couldn't resolve the issues pointed out from code review on time but I'm good now |
Hi @lihaoyi took a break off the issue fro sometime, now working on it I want to ask how to use
Got something like this as error
|
@c0d33ngr |
Okay thank you, trying it out |
@0xnm please review when less busy. I've done the changes you requested Also, to make use of
|
Hi @0xnm do you have any idea to why the lint cli tool couldn't spot the it? |
I suggest you to check the arguments you are calling |
Okay... I'll look into that What think of the PR any changes needed? |
Hi @0xnm , the suggestion you gave work. It was the You can review when less busy |
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.
It looks reasonable to me. This first drop of lint support doesn't obviously support all the configuration options available in AGP and options supported by the tool, but it is a reasonable basis for doing a simple lint run.
One more handy thing to have is maybe to provide module-independent runner/report collector (see existing verification tooling modules in the codebase, they have static methods with Evaluator
), but it is not a blocker for me.
I left some comments, for the rest I think @lihaoyi can do a review.
@@ -11,7 +11,6 @@ | |||
** xref:javalib/publishing.adoc[] | |||
** xref:javalib/build-examples.adoc[] | |||
** xref:javalib/web-examples.adoc[] | |||
|
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.
probably a change to rollback? seems like this was a separator
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.
please I do not fully understand what you meant here
val cp = runClasspath().map(_.path).filter(os.exists).mkString(":") | ||
|
||
// Set path to the location of the project source codes | ||
val src = sources().map(_.path / "main" / "java").filter(os.exists).mkString(":") |
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.
I think you shouldn't hardcode path as main/java
, because both pieces can be actually different. I would suggest to use Lib.findSourceFiles
(extension can be both .java
and .kotlin
) at least with the given sources
.
Ideally, in order to not have a huge path with each individual files there, it should be a way to find a common roots for the given set of the files, but I don't know if there are utility methods in the project's codebase to compute that.
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.
I needed directory path to the sources file that's why I did that using the most common /src/main/java
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.
actual files can be under any path of sources()
root, so hardcoding main/java
doesn't work: nothing prevents having source files under sources()/foo/bar/foobar
, for example.
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.
It's true, in that case I will let the user be able to set it via the build.mill
file, leaving the default
This looks great, I'll merge it and fix the checkBrokenLinks error myself. @c0d33ngr I'll close out the bounty using the bank information you sent me earlier |
No, |
Okay.. No wonder it breaks the mill test if |
This is meant to to be a draft of item number 4 of issue #3868. The android linting
Hi @lihaoyi is this close to what you have in mind about the android linting or there's more?