Skip to contentSkip to conversation

misc meson.build and clang-format updates

PATCH In review Vishal Verma 3 participants 5 messages Dec 6, 2022 – Dec 7, 2022

Subsystems (3)
lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

cover misc meson.build and clang-format updates

Patch 1 adds a .clang-format option to reformat macros for aligning

Patch 2 squelches a warning from a meson update.

Cc Dan Williams <[email protected]>
Cc Alison Schofield <[email protected]>

---
Vishal Verma (2):
clang-format: Align consecutive macros and #defines meson.build: add a check argument to run_command

 .clang-format | 1 +
 meson.build   | 1 +
 2 files changed, 2 insertions(+)

---
base-commit: 3591a1bea2bd90349963b02aeb9064dc3fbd3d83
change-id: 20221206-vv-misc-12ffd1061e0a

Best regards,

Signature · 1 line
Vishal Verma <[email protected]>
author maintainer
#1 lore raw

PATCH 1/2 clang-format: Align consecutive macros and #defines

Add AlignConsecutiveMacros: true so that blocks of consecutive #defines can be neatly aligned.

---
 .clang-format | 1 +
 1 file changed, 1 insertion(+)
.clang-format +1 -0
index b6169e1..9ea49bf 100644
@@ -13,6 +13,7 @@ AccessModifierOffset: -4
 AlignAfterOpenBracket: Align
 AlignConsecutiveAssignments: false
 AlignConsecutiveDeclarations: false
+AlignConsecutiveMacros: true
 #AlignEscapedNewlines: Left # Unknown to clang-format-4.0
 AlignOperands: true
 AlignTrailingComments: false
Signature · 1 line
2.38.1
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH ndctl 1/2] clang-format: Align consecutive macros and #defines

Quoted 7 lines · Vishal Verma

Add AlignConsecutiveMacros: true so that blocks of consecutive #defines can be neatly aligned.

---

Thanks Vishal!

Quoted 18 lines
 .clang-format | 1 +
 1 file changed, 1 insertion(+)
.clang-format +1 -0
index b6169e1..9ea49bf 100644
@@ -13,6 +13,7 @@ AccessModifierOffset: -4
 AlignAfterOpenBracket: Align
 AlignConsecutiveAssignments: false
 AlignConsecutiveDeclarations: false
+AlignConsecutiveMacros: true
 #AlignEscapedNewlines: Left # Unknown to clang-format-4.0
 AlignOperands: true
 AlignTrailingComments: false
Signature · 2 lines
-- 
2.38.1
author maintainer
#3 lore raw

PATCH 2/2 meson.build: add a check argument to run_command

In reply to Vishal Verma

Meson has started to warn about:

WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300

There is one instance of run_command() in the top-level meson.build which elides the explicit check argument. Since we don't care about the result of clean_config.sh (if any config.h are found they will be cleaned, and if none are found, we're fine), add a 'check: false' argument to this and squelch the warning.

---
 meson.build | 1 +
 1 file changed, 1 insertion(+)
meson.build +1 -0
index 20a646d..33ed0ed 100644
@@ -89,6 +89,7 @@ env = find_program('env')
 if git.found()
   run_command('clean_config.sh',
     env : 'GIT_DIR=@0@/.git'.format(project_source_root),
+    check : false,
   )
 endif
 
Signature · 1 line
2.38.1
Reviewed-by on v1 2/2
#4 lore raw

RE: [PATCH ndctl 2/2] meson.build: add a check argument to run_command

Quoted 7 lines · Vishal Verma

Meson has started to warn about:

WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300

Quoted 5 lines

There is one instance of run_command() in the top-level meson.build which elides the explicit check argument. Since we don't care about the result of clean_config.sh (if any config.h are found they will be cleaned, and if none are found, we're fine), add a 'check: false' argument to this and squelch the warning.

Looks good to me: