mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-05 14:09:53 +03:00
utils/check-package: add a check for the new spacing convention
The seperation of the fields in the hash file should be 2 spaces for consistency. Since a large number of hash files still violate this rule, exclude it from "make check-package" (and thus from CI). Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Cc: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> [Arnout: - Move it to a separate class, so it can be excluded. - Exclude it from "make check-package" ] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
committed by
Arnout Vandecappelle (Essensium/Mind)
parent
f81242ae4f
commit
f35a4b4ae2
@@ -53,3 +53,19 @@ class HashType(_CheckFunction):
|
||||
.format(self.filename, lineno, self.url_to_manual),
|
||||
text,
|
||||
"expected {} hex digits".format(self.len_of_hash[htype])]
|
||||
|
||||
|
||||
class HashSpaces(_CheckFunction):
|
||||
def check_line(self, lineno, text):
|
||||
if _empty_line_or_comment(text):
|
||||
return
|
||||
|
||||
fields = text.split()
|
||||
if len(fields) != 3:
|
||||
# Handled by HashNumberOfFields
|
||||
return
|
||||
|
||||
if not re.match(re.escape("{} {} {}".format(*fields)), text):
|
||||
return ["{}:{}: separation does not match expectation "
|
||||
"({}#adding-packages-hash)"
|
||||
.format(self.filename, lineno, self.url_to_manual), text]
|
||||
|
||||
Reference in New Issue
Block a user