[libcamera-devel,1/4] Add .clang-tidy
diff mbox series

Message ID 20201022081731.36217-1-tomi.valkeinen@iki.fi
State Accepted
Headers show
Series
  • [libcamera-devel,1/4] Add .clang-tidy
Related show

Commit Message

Tomi Valkeinen Oct. 22, 2020, 8:17 a.m. UTC
Having .clang-tidy file will give us a 'clang-tidy' meson build target,
so doing a full clang-tidy run can be done just by:

ninja -C build clang-tidy

I did not look at if more checks should be enabled or not. I disabled
clang-diagnostic-c99-designator as that feature was used in the code,
and I see no harm with the feature.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
---
 .clang-tidy | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 .clang-tidy

Comments

Kieran Bingham Oct. 22, 2020, 9:56 a.m. UTC | #1
Hi Tomi,

On 22/10/2020 09:17, Tomi Valkeinen wrote:
> Having .clang-tidy file will give us a 'clang-tidy' meson build target,
> so doing a full clang-tidy run can be done just by:
> 
> ninja -C build clang-tidy
> 
> I did not look at if more checks should be enabled or not. I disabled
> clang-diagnostic-c99-designator as that feature was used in the code,
> and I see no harm with the feature.

Ha, I already have one of these in my tree. Though mine is just a blank
file (which is enough to enable the ninja target).


> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>

Therefore, I think adding this officially is a good idea ;-)

I wonder if we could integrate this into checkstyle so that it reports
any additional warnings introduced by new patches - but that could be
quite difficult to implement as clang-tidy will look at the bigger tree,
so I'll leave it as a pipe dream for now ;-)

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  .clang-tidy | 3 +++
>  1 file changed, 3 insertions(+)
>  create mode 100644 .clang-tidy
> 
> diff --git a/.clang-tidy b/.clang-tidy
> new file mode 100644
> index 00000000..4c47fa8c
> --- /dev/null
> +++ b/.clang-tidy
> @@ -0,0 +1,3 @@
> +Checks:		-clang-diagnostic-c99-designator
> +FormatStyle:	file
> +
>

Patch
diff mbox series

diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 00000000..4c47fa8c
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,3 @@ 
+Checks:		-clang-diagnostic-c99-designator
+FormatStyle:	file
+