[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v3 15/32] scripts/qapi: strip trailing whitespaces
From: |
marcandre . lureau |
Subject: |
[RFC v3 15/32] scripts/qapi: strip trailing whitespaces |
Date: |
Tue, 7 Sep 2021 16:19:26 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
This help workaround a rustfmt issue.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
scripts/qapi/gen.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index ab26d5c937..fa23f43808 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -50,7 +50,11 @@ def add(self, text: str) -> None:
self._body += text
def get_content(self) -> str:
- return self._top() + self._preamble + self._body + self._bottom()
+ content = self._top() + self._preamble + self._body + self._bottom()
+ # delete trailing white-spaces (working around
+ # https://github.com/rust-lang/rustfmt/issues/4248)
+ content = re.sub(r'\s+$', '\n', content, 0, re.M)
+ return content
def _top(self) -> str:
# pylint: disable=no-self-use
--
2.33.0.113.g6c40894d24
[RFC v3 14/32] scripts/qapi: add QAPISchemaIfCond.rsgen(), marcandre . lureau, 2021/09/07
[RFC v3 15/32] scripts/qapi: strip trailing whitespaces,
marcandre . lureau <=
[RFC v3 16/32] scripts/qapi: add Rust FFI bindings generation, marcandre . lureau, 2021/09/07
[RFC v3 17/32] scripts/qapi: learn to generate ABI dump for Rust FFI, marcandre . lureau, 2021/09/07
[RFC v3 18/32] tests: generate Rust bindings, marcandre . lureau, 2021/09/07
[RFC v3 19/32] tests: check Rust and C CABI diffs, marcandre . lureau, 2021/09/07
[RFC v3 20/32] scripts/qapi: generate high-level Rust bindings, marcandre . lureau, 2021/09/07
[RFC v3 22/32] qga: build qapi-cabi binary (ABI from C), marcandre . lureau, 2021/09/07
[RFC v3 21/32] tests/rust: build a common library, checking bindings compile, marcandre . lureau, 2021/09/07
[RFC v3 23/32] qga/rust: build and link an empty static library, marcandre . lureau, 2021/09/07
[RFC v3 24/32] qga/rust: generate QGA QAPI types FFI bindings, marcandre . lureau, 2021/09/07
[RFC v3 25/32] qga/rust: build a qga-cabi-rs executable (ABI from Rust), marcandre . lureau, 2021/09/07