utils/checkpackagelib: CommentsMenusPackagesOrder: initialize in before()
authorJerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Sat, 5 Oct 2019 12:22:18 +0000 (14:22 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Mon, 7 Oct 2019 21:39:21 +0000 (23:39 +0200)
This makes sure the state from a previous run (previous file) can never
leak over into the next file.

Also order the initializations alphabetically.

Signed-off-by: Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Acked-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
utils/checkpackagelib/lib_config.py

index d1d4a4f5495949386f742158bb957b8de191f4ae..c5d0dc0fdb50235ce4465ce7793fe8632b540631 100644 (file)
@@ -61,14 +61,13 @@ class AttributesOrder(_CheckFunction):
 
 
 class CommentsMenusPackagesOrder(_CheckFunction):
-    menu_of_packages = [""]
-    package = [""]
-    print_package_warning = [True]
-
     def before(self):
-        self.state = ""
         self.level = 0
+        self.menu_of_packages = [""]
         self.new_package = ""
+        self.package = [""]
+        self.print_package_warning = [True]
+        self.state = ""
 
     def get_level(self):
         return len(self.state.split('-')) - 1