ソースを参照

utils/checkpackagelib: really check variable name

Currently, when a package defines an unprefixed variable, but its value
contains a properly prefixed expansion (or even just the name of a
variable), there is not error reported (e.g. with the recently fixed
composer issue):

    BASE_SITE = https://getcomposer.org/download/$(COMPOSER_VERSION)/composer.phar

The reason is that he check is done on the whole line, rather than on
the variable that is being set.

We fix that by really looking at the variable we found, instead of
looking in the whole line.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@datacom.com.br>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Yann E. MORIN 1 年間 前
コミット
b0964df557
1 ファイル変更1 行追加1 行削除
  1. 1 1
      utils/checkpackagelib/lib_mk.py

+ 1 - 1
utils/checkpackagelib/lib_mk.py

@@ -316,7 +316,7 @@ class TypoInPackageVariable(_CheckFunction):
 
 
         if self.ALLOWED.match(variable):
         if self.ALLOWED.match(variable):
             return
             return
-        if self.REGEX.search(text) is None:
+        if self.REGEX.search(variable) is None:
             return ["{}:{}: possible typo: {} -> *{}*"
             return ["{}:{}: possible typo: {} -> *{}*"
                     .format(self.filename, lineno, variable, self.package),
                     .format(self.filename, lineno, variable, self.package),
                     text]
                     text]