diff options
author | Jakub Kicinski <kuba@kernel.org> | 2025-05-09 08:42:12 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2025-05-13 13:22:32 +0200 |
commit | 9ba8e351efd4d003a7fc22bc7455f0e95665cf44 (patch) | |
tree | 73cca3b24befa99abeaf720c7b16bda238f33300 /tools/net/ynl/pyynl/ynl_gen_c.py | |
parent | 02a562bb2b0846f44bb4226b7ee7ef9821c3780e (diff) |
tools: ynl-gen: auto-indent else
We auto-indent if statements (increase the indent of the subsequent
line by 1), do the same thing for else branches without a block.
There hasn't been any else branches before but we're about to add one.
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250509154213.1747885-3-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/net/ynl/pyynl/ynl_gen_c.py')
-rwxr-xr-x | tools/net/ynl/pyynl/ynl_gen_c.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py index 4e2ae738c0aa..9a5c65966e9d 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -1458,6 +1458,7 @@ class CodeWriter: if self._silent_block: ind += 1 self._silent_block = line.endswith(')') and CodeWriter._is_cond(line) + self._silent_block |= line.strip() == 'else' if line[0] == '#': ind = 0 if add_ind: |