From dd251d68e5995b7c146c9712ce25a187a25b87de Mon Sep 17 00:00:00 2001 From: Jerzy Grzegorek Date: Sat, 5 Oct 2019 14:22:15 +0200 Subject: [PATCH] utils/checkpackagelib: CommentsMenusPackagesOrder: remove '-comment' state before the '-menu' one A comment is considered an alternative delimiter like a menu. I.e., a menu that comes after a comment should not be considered a submenu of that comment. Therefore, remove the '-comment' state before adding the '-menu' one. Signed-off-by: Jerzy Grzegorek Cc: Ricardo Martincoski Reviewed-by: Ricardo Martincoski Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- utils/checkpackagelib/lib_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/checkpackagelib/lib_config.py b/utils/checkpackagelib/lib_config.py index fc0df3dd17..499660feb7 100644 --- a/utils/checkpackagelib/lib_config.py +++ b/utils/checkpackagelib/lib_config.py @@ -107,6 +107,9 @@ class CommentsMenusPackagesOrder(_CheckFunction): self.state += "-if" elif text.startswith("menu"): + if self.state.endswith("-comment"): + self.state = self.state[:-8] + self.state += "-menu" self.initialize_level_elements(text) -- 2.30.2