[libvirt] [PATCH] cfg.mk: Simplify backslash alignment check

Andrea Bolognani posted 1 patch 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20171204101206.22431-1-abologna@redhat.com
cfg.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[libvirt] [PATCH] cfg.mk: Simplify backslash alignment check
Posted by Andrea Bolognani 6 years, 4 months ago
The use of [[:blank:]] was intended to cover tabs as well, but
it couldn't possibly work in its current form, so the regex was
tweaked in d09429abe826.

With the original reason for using [[:blank:]] now gone, we can
replace its usage with plain spaces. A comment about the purpose
of the check is added as well.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 cfg.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cfg.mk b/cfg.mk
index ea10ca19f..5cdeb7c65 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1037,8 +1037,10 @@ sc_prohibit_http_urls:
 	halt='Links must use https:// protocol' \
 	  $(_sc_search_regexp)
 
+# Alignment is usually achieved through spaces (at least two of them)
+# or tabs (at least one of them) right before the trailing backslash
 sc_prohibit_backslash_alignment:
-	@prohibit='([[:blank:]][[:blank:]]|	)\\$$' \
+	@prohibit='(  |	)\\$$' \
 	in_vc_files='*\.([chx]|am|mk)$$' \
 	halt='Do not attempt to right-align backslashes' \
 	  $(_sc_search_regexp)
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] cfg.mk: Simplify backslash alignment check
Posted by Martin Kletzander 6 years, 4 months ago
On Mon, Dec 04, 2017 at 11:12:06AM +0100, Andrea Bolognani wrote:
>The use of [[:blank:]] was intended to cover tabs as well, but
>it couldn't possibly work in its current form, so the regex was
>tweaked in d09429abe826.
>
>With the original reason for using [[:blank:]] now gone, we can
>replace its usage with plain spaces. A comment about the purpose
>of the check is added as well.
>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>
>---
> cfg.mk | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>

ACK

>diff --git a/cfg.mk b/cfg.mk
>index ea10ca19f..5cdeb7c65 100644
>--- a/cfg.mk
>+++ b/cfg.mk
>@@ -1037,8 +1037,10 @@ sc_prohibit_http_urls:
> 	halt='Links must use https:// protocol' \
> 	  $(_sc_search_regexp)
>
>+# Alignment is usually achieved through spaces (at least two of them)
>+# or tabs (at least one of them) right before the trailing backslash
> sc_prohibit_backslash_alignment:
>-	@prohibit='([[:blank:]][[:blank:]]|	)\\$$' \
>+	@prohibit='(  |	)\\$$' \
> 	in_vc_files='*\.([chx]|am|mk)$$' \
> 	halt='Do not attempt to right-align backslashes' \
> 	  $(_sc_search_regexp)
>-- 
>2.14.3
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list