utils/checkpackagelib: CommentsMenusPackagesOrder: initialize in before()

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>
This commit is contained in:
Jerzy Grzegorek 2019-10-05 14:22:18 +02:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 6a5f6ea7e2
commit b47590fdb0

View 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