Skip to content
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

Bear proposal : AndroidBear #1534

Open
satwikkansal opened this issue Mar 23, 2017 · 9 comments
Open

Bear proposal : AndroidBear #1534

satwikkansal opened this issue Mar 23, 2017 · 9 comments

Comments

@satwikkansal
Copy link
Member

satwikkansal commented Mar 23, 2017

Apart from the IntelliJ and Eclipse integrations, Android's "lint" also has a CLI tool which can be wrapped to make AndroidBear.

http://tools.android.com/tips/lint/
http://tools.android.com/tips/lint-checks

@mridubhatnagar
Copy link

Please can you elaborate the approach that is needed to write AndroidBear.

@satwikkansal
Copy link
Member Author

Hey, so the basic idea is to wrap http://tools.android.com/tips/lint/ into a bear. For the approach, you can read https://api.coala.io/en/latest/Developers/Writing_Linter_Bears.html guide.

@naman1901
Copy link
Member

Hi. I'm new here, could you explain where the .exe file for this will go in the package? The tutorial works with pylint which can be installed via pip. Where does the android lint exe go?

@jayvdb
Copy link
Member

jayvdb commented May 26, 2017

You would declare an ExecutableRequirement on lint.
Then the caller needs to have that program in their PATH, and the bear will work.

@Makman2
Copy link
Member

Makman2 commented May 26, 2017

I'm not sure if Android Studio (which is the usual way to install Android dev tools) places those tools into the PATH. We should have a fallback checking for example for ANDROID_SDK_HOME environment variable.

@theevangelista
Copy link

The Android Studio does not include ANDROID_HOME env var by default, the user needs to do it to use external tools not integrated by AS, so to use the lint executable, the user will need to put the path ANDROID_HOME/tools/bin on the PATH so lint is usable, usually Android devs puts the ANDROID_HOME as soon as AS is installed, since it is widely used.

@Makman2
Copy link
Member

Makman2 commented Oct 17, 2017

So seems there are many different ways to export those linting binaries. Looks like we have to write custom requirement classes accounting for the most popular ones^^ But shouldn't be too hard 👍

@aashraybhandar1
Copy link
Contributor

Can someone guide me how to write tests for this bear ? Also should an option for various checks be provided?

@Makman2
Copy link
Member

Makman2 commented Nov 15, 2017

@aashraybhandar1 see other test files 👍

Also should an option for various checks be provided?

Definitely 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

8 participants