[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/9] tests/style: check for mixups of bool constants with int
From: |
Daniel P . Berrangé |
Subject: |
[PATCH v3 3/9] tests/style: check for mixups of bool constants with int variables |
Date: |
Thu, 7 Jul 2022 17:37:14 +0100 |
The 'true' and 'false' constants should only ever be used with the
'bool' type, never 'int'.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tests/style.yml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/style.yml b/tests/style.yml
index b4e7c6111f..704227d8e9 100644
--- a/tests/style.yml
+++ b/tests/style.yml
@@ -86,3 +86,8 @@
# A match added to the front of the regex. Useful when
# 'terms' is a list of strings and a common prefix is
# desired
+
+int_assign_bool:
+ files: \.c$
+ prohibit: \<int\>.*= *(true|false)\b
+ message: use bool type for boolean values
--
2.36.1
- Re: [PATCH v3 1/9] tests: introduce tree-wide code style checking, (continued)
Re: [PATCH v3 1/9] tests: introduce tree-wide code style checking, Eric Blake, 2022/07/21
[PATCH v3 9/9] tests/style: check qemu/osdep.h is NOT included in all .h/.c.inc files, Daniel P . Berrangé, 2022/07/07
[PATCH v3 6/9] misc: ensure qemu/osdep.h is included first in all .c files, Daniel P . Berrangé, 2022/07/07
[PATCH v3 3/9] tests/style: check for mixups of bool constants with int variables,
Daniel P . Berrangé <=
[PATCH v3 5/9] tests/style: check for commonly doubled up words, Daniel P . Berrangé, 2022/07/07
[PATCH v3 8/9] misc: remove qemu/osdep.h from headers / included source files, Daniel P . Berrangé, 2022/07/07
[PATCH v3 4/9] misc: fix commonly doubled up words, Daniel P . Berrangé, 2022/07/07