Discussion:
Any good idea how to run clang tidy in Android build
butter
2018-03-31 02:12:52 UTC
Permalink
Hi,

I want to run clang-tidy in Android build and want to integrated to
my CI , the question I meet is that there seems no quick way to run it I
tried

1. manually scan files and add -I but that not good way for many repos to
generate
2. tried with run run-clang-tidy.py in prebuilts but seem it need compile_commands.json
file for input, and all instruction I googled are for Cmake or
makefile(bear)
3.tried ninja -t compdb way from LLVM website
<https://sarcasm.github.io/notes/dev/compilation-database.html>  and it
turns out phrase nothing out in my build.ninja file in out/ generated from
Android build

Is there any good way to run clang tidy in Android build

BRs,

butter
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Dan Albert' via android-ndk
2018-04-02 20:36:53 UTC
Permalink
If you're using ndk-build, this support is actually built in for r18 (not
released yet, but if you're feeling adventurous you could try patching the
relevant commit into your copy of ndk-build):
https://android-review.googlesource.com/c/platform/ndk/+/632426

You could also grab a canary build:
https://android.googlesource.com/platform/ndk/+/master/docs/ContinuousBuilds.md.
I definitely would not recommend using a canary NDK for a production build
though.
Post by butter
Hi,
I want to run clang-tidy in Android build and want to integrated to
my CI , the question I meet is that there seems no quick way to run it I
tried
1. manually scan files and add -I but that not good way for many repos to
generate
2. tried with run run-clang-tidy.py in prebuilts but seem it need compile_commands.json
file for input, and all instruction I googled are for Cmake or
makefile(bear)
3.tried ninja -t compdb way from LLVM website
<https://sarcasm.github.io/notes/dev/compilation-database.html>  and it
turns out phrase nothing out in my build.ninja file in out/ generated from
Android build
Is there any good way to run clang tidy in Android build
BRs,
butter
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGht6e5m1QrXDHzAuhOE60UxdyMeZm%2BCu8XCZW_OtCj_ofA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Norm Evangelista
2018-05-31 21:27:30 UTC
Permalink
But how do you enable clang-tidy checks for your own (native) code? I
believe that's what the OP is asking.
Post by 'Dan Albert' via android-ndk
If you're using ndk-build, this support is actually built in for r18 (not
released yet, but if you're feeling adventurous you could try patching the
https://android-review.googlesource.com/c/platform/ndk/+/632426
https://android.googlesource.com/platform/ndk/+/master/docs/ContinuousBuilds.md.
I definitely would not recommend using a canary NDK for a production build
though.
Post by butter
Hi,
I want to run clang-tidy in Android build and want to integrated
to my CI , the question I meet is that there seems no quick way to run it
I tried
1. manually scan files and add -I but that not good way for many repos
to generate
2. tried with run run-clang-tidy.py in prebuilts but seem it need compile_commands.json
file for input, and all instruction I googled are for Cmake or
makefile(bear)
3.tried ninja -t compdb way from LLVM website
<https://sarcasm.github.io/notes/dev/compilation-database.html>  and
it turns out phrase nothing out in my build.ninja file in out/ generated
from Android build
Is there any good way to run clang tidy in Android build
BRs,
butter
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/7f1194a4-2d24-4c42-aacd-5a334053b0fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Dan Albert' via android-ndk
2018-06-01 03:14:49 UTC
Permalink
Exactly as shown in the patch above (look at the test case).

r18 isn't quite in beta yet though, so it's still not really available.
Post by Norm Evangelista
But how do you enable clang-tidy checks for your own (native) code? I
believe that's what the OP is asking.
Post by 'Dan Albert' via android-ndk
If you're using ndk-build, this support is actually built in for r18 (not
released yet, but if you're feeling adventurous you could try patching the
https://android-review.googlesource.com/c/platform/ndk/+/632426
https://android.googlesource.com/platform/ndk/+/master/docs/ContinuousBuilds.md.
I definitely would not recommend using a canary NDK for a production build
though.
Post by butter
Hi,
I want to run clang-tidy in Android build and want to integrated
to my CI , the question I meet is that there seems no quick way to run it
I tried
1. manually scan files and add -I but that not good way for many repos
to generate
2. tried with run run-clang-tidy.py in prebuilts but seem it need compile_commands.json
file for input, and all instruction I googled are for Cmake or
makefile(bear)
3.tried ninja -t compdb way from LLVM website
<https://sarcasm.github.io/notes/dev/compilation-database.html>  and
it turns out phrase nothing out in my build.ninja file in out/ generated
from Android build
Is there any good way to run clang tidy in Android build
BRs,
butter
--
You received this message because you are subscribed to the Google
Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/f16175fa-7c67-4b59-975e-9c4c6660083f%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/7f1194a4-2d24-4c42-aacd-5a334053b0fa%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/7f1194a4-2d24-4c42-aacd-5a334053b0fa%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhtRVmByVQeA4NbpFdpaUnBg_oGPigpmtB8gvn4keUfQLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...