diff mbox series

libstdc++: editorconfig: Adjust wildcard patterns

Message ID 20241206175948.2347582-1-mmalcomson@nvidia.com
State New
Headers show
Series libstdc++: editorconfig: Adjust wildcard patterns | expand

Commit Message

Matthew Malcomson Dec. 6, 2024, 5:59 p.m. UTC
From: Matthew Malcomson <mmalcomson@nvidia.com>

According to the editorconfig file format description, a match against
one of multiple different strings is described with those different
strings separated by commas and within curly braces.  E.g.
    [{x,y}.txt]

https://editorconfig.org/, under "Wildcard Patterns".

The current libstdc++-v3/.editorconfig file has a few places where we
match against similar globs by using strings separated by commas but
without the curly braces.  E.g.
    [*.h,*.cc]

This doesn't take affect in neovim nor emacs (as far as I can tell), I
haven't looked into other editors.
I would expect that following the standard syntax described in the
documentation would satisfy more editors.  Hence this patch suggests
following that standard by using something like:
    [*.{h,cc}]

libstdc++-v3/ChangeLog:

	* .editorconfig: Adjust globbing style to standard syntax.

Signed-off-by: Matthew Malcomson <mmalcomson@nvidia.com>
---
 libstdc++-v3/.editorconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jonathan Wakely Dec. 6, 2024, 9:36 p.m. UTC | #1
On Fri, 6 Dec 2024 at 18:01, <mmalcomson@nvidia.com> wrote:
>
> From: Matthew Malcomson <mmalcomson@nvidia.com>
>
> According to the editorconfig file format description, a match against
> one of multiple different strings is described with those different
> strings separated by commas and within curly braces.  E.g.
>     [{x,y}.txt]
>
> https://editorconfig.org/, under "Wildcard Patterns".
>
> The current libstdc++-v3/.editorconfig file has a few places where we
> match against similar globs by using strings separated by commas but
> without the curly braces.  E.g.
>     [*.h,*.cc]

Huh, I wonder why I thought that was valid.

> This doesn't take affect in neovim nor emacs (as far as I can tell), I
> haven't looked into other editors.
> I would expect that following the standard syntax described in the
> documentation would satisfy more editors.  Hence this patch suggests
> following that standard by using something like:
>     [*.{h,cc}]
>
> libstdc++-v3/ChangeLog:
>
>         * .editorconfig: Adjust globbing style to standard syntax.

OK, thanks

>
> Signed-off-by: Matthew Malcomson <mmalcomson@nvidia.com>
> ---
>  libstdc++-v3/.editorconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/.editorconfig b/libstdc++-v3/.editorconfig
> index 88107cedda2..c95e4e26f7a 100644
> --- a/libstdc++-v3/.editorconfig
> +++ b/libstdc++-v3/.editorconfig
> @@ -5,14 +5,14 @@ root = true
>  end_of_line = lf
>  insert_final_newline = true
>
> -[*.h,*.cc]
> +[*.{h,cc}]
>  charset = utf-8
>  indent_style = tab
>  indent_size = 2
>  tab_width = 8
>  trim_trailing_whitespace = true
>
> -[Makefile*,ChangeLog*]
> +[{Makefile,ChangeLog}*]
>  indent_style = tab
>  indent_size = 8
>  trim_trailing_whitespace = true
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/libstdc++-v3/.editorconfig b/libstdc++-v3/.editorconfig
index 88107cedda2..c95e4e26f7a 100644
--- a/libstdc++-v3/.editorconfig
+++ b/libstdc++-v3/.editorconfig
@@ -5,14 +5,14 @@  root = true
 end_of_line = lf
 insert_final_newline = true
 
-[*.h,*.cc]
+[*.{h,cc}]
 charset = utf-8
 indent_style = tab
 indent_size = 2
 tab_width = 8
 trim_trailing_whitespace = true
 
-[Makefile*,ChangeLog*]
+[{Makefile,ChangeLog}*]
 indent_style = tab
 indent_size = 8
 trim_trailing_whitespace = true