mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-15 22:41:38 +00:00
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>
This commit is contained in:
committed by
Paolo Abeni
parent
02a562bb2b
commit
9ba8e351ef
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user