mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 05:51:45 -09:00
utils/check-package: require exactly 1 TAB and 2 SP on help text 1st line
Test that the first line starts exactly with one TAB and exactly two spaces before the text. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ricardo Martincoski <ricardo.martincoski@datacom.com.br> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
064ddfc997
commit
f9e6d39e8e
@@ -154,6 +154,7 @@ class CommentsMenusPackagesOrder(_CheckFunction):
|
|||||||
|
|
||||||
class HelpText(_CheckFunction):
|
class HelpText(_CheckFunction):
|
||||||
HELP_TEXT_FORMAT = re.compile(r"^\t .{,62}$")
|
HELP_TEXT_FORMAT = re.compile(r"^\t .{,62}$")
|
||||||
|
HELP_TEXT_FORMAT_1 = re.compile(r"^\t \S.{,61}$")
|
||||||
URL_ONLY = re.compile(r"^(http|https|git)://\S*$")
|
URL_ONLY = re.compile(r"^(http|https|git)://\S*$")
|
||||||
|
|
||||||
def before(self):
|
def before(self):
|
||||||
@@ -170,12 +171,18 @@ class HelpText(_CheckFunction):
|
|||||||
return
|
return
|
||||||
if text.strip() == "help":
|
if text.strip() == "help":
|
||||||
self.help_text = True
|
self.help_text = True
|
||||||
|
self.help_first_line = True
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.help_text:
|
if not self.help_text:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.HELP_TEXT_FORMAT.match(text.rstrip()):
|
if self.help_first_line:
|
||||||
|
help_text_match = self.HELP_TEXT_FORMAT_1
|
||||||
|
self.help_first_line = False
|
||||||
|
else:
|
||||||
|
help_text_match = self.HELP_TEXT_FORMAT
|
||||||
|
if help_text_match.match(text.rstrip()):
|
||||||
return
|
return
|
||||||
if self.URL_ONLY.match(text.strip()):
|
if self.URL_ONLY.match(text.strip()):
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user