diff options
| author | Charles Brunet <charles.brunet@optelgroup.com> | 2025-09-30 15:34:34 -0400 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-10-01 11:38:00 -0700 |
| commit | 535310fb4dde8097fea15c003f37910bed04b20a (patch) | |
| tree | be2297a60577c1e83bcfc4af1c40981bb0098f6a | |
| parent | 098dc533d659a9ee6e987d46dfcd918bfb133ca3 (diff) | |
| download | meson-535310fb4dde8097fea15c003f37910bed04b20a.tar.gz | |
format: fix handling whitespaces after string node
Fixes #15019
| -rw-r--r-- | mesonbuild/mformat.py | 2 | ||||
| -rw-r--r-- | test cases/format/5 transform/default.expected.meson | 13 | ||||
| -rw-r--r-- | test cases/format/5 transform/muon.expected.meson | 13 | ||||
| -rw-r--r-- | test cases/format/5 transform/options.expected.meson | 13 | ||||
| -rw-r--r-- | test cases/format/5 transform/source.meson | 13 |
5 files changed, 53 insertions, 1 deletions
diff --git a/mesonbuild/mformat.py b/mesonbuild/mformat.py index 1bf7effd9..184a9d31f 100644 --- a/mesonbuild/mformat.py +++ b/mesonbuild/mformat.py @@ -371,7 +371,7 @@ class TrimWhitespaces(FullAstVisitor): if node.is_fstring and '@' not in node.value: node.is_fstring = False - self.exit_node(node) + node.whitespaces.accept(self) def visit_UnaryOperatorNode(self, node: mparser.UnaryOperatorNode) -> None: super().visit_UnaryOperatorNode(node) diff --git a/test cases/format/5 transform/default.expected.meson b/test cases/format/5 transform/default.expected.meson index 702ae5643..91b3bc239 100644 --- a/test cases/format/5 transform/default.expected.meson +++ b/test cases/format/5 transform/default.expected.meson @@ -94,4 +94,17 @@ if true endif endif +# issue #15019 +if get_option('client') + sources += files( + 'pypaste/client/__init__.py', + 'pypaste/client/__main__.py', + 'pypaste/client/plugins/__init__.py', + 'pypaste/client/plugins/pgz/__init__.py', + 'pypaste/client/plugins/zen/__init__.py', + ) + + dependencies += ['requests'] +endif + # no final endline diff --git a/test cases/format/5 transform/muon.expected.meson b/test cases/format/5 transform/muon.expected.meson index f01849734..e7d461012 100644 --- a/test cases/format/5 transform/muon.expected.meson +++ b/test cases/format/5 transform/muon.expected.meson @@ -94,4 +94,17 @@ if true endif endif +# issue #15019 +if get_option('client') + sources += files( + 'pypaste/client/__init__.py', + 'pypaste/client/__main__.py', + 'pypaste/client/plugins/__init__.py', + 'pypaste/client/plugins/zen/__init__.py', + 'pypaste/client/plugins/pgz/__init__.py', + ) + + dependencies += ['requests'] +endif + # no final endline diff --git a/test cases/format/5 transform/options.expected.meson b/test cases/format/5 transform/options.expected.meson index 7136506c0..756c226f5 100644 --- a/test cases/format/5 transform/options.expected.meson +++ b/test cases/format/5 transform/options.expected.meson @@ -62,4 +62,17 @@ if true endif endif +# issue #15019 +if get_option('client') + sources += files( + 'pypaste/client/__init__.py', + 'pypaste/client/__main__.py', + 'pypaste/client/plugins/__init__.py', + 'pypaste/client/plugins/pgz/__init__.py', + 'pypaste/client/plugins/zen/__init__.py', + ) + + dependencies += [ 'requests' ] +endif + # no final endline
\ No newline at end of file diff --git a/test cases/format/5 transform/source.meson b/test cases/format/5 transform/source.meson index 554b9e6a7..a4004125b 100644 --- a/test cases/format/5 transform/source.meson +++ b/test cases/format/5 transform/source.meson @@ -50,4 +50,17 @@ if true endif endif +# issue #15019 +if get_option('client') + sources += files( + 'pypaste/client/__init__.py', + 'pypaste/client/__main__.py', + 'pypaste/client/plugins/__init__.py', + 'pypaste/client/plugins/zen/__init__.py', + 'pypaste/client/plugins/pgz/__init__.py' + ) + + dependencies += ['requests'] +endif + # no final endline
\ No newline at end of file |
