Fix regex for source

Current regex will match any of the ten line after the official helper files starting with the string "source". 
Thus, in my specific case for which I declare a variable named source_filename="{...}", the linter will display a warning for it: `    ! Please avoid sourcing additional helpers after the official helpers (in this case file _filename=$(basename$upstream__url)) `.
As it should be only interested in matching the command `source` (`source path/to/file`), a space should be appended to the current regex.
This commit is contained in:
oleole39 2024-02-19 22:13:30 +01:00 committed by GitHub
parent 8c00413d2f
commit 7110959e51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2797,7 +2797,7 @@ class Script(TestSuite):
@test() @test()
def helpers_sourcing_after_official(self): def helpers_sourcing_after_official(self):
helpers_after_official = subprocess.check_output( helpers_after_official = subprocess.check_output(
"head -n 30 '%s' | grep -A 10 '^ *source */usr/share/yunohost/helpers' | grep '^ *source' | tail -n +2" "head -n 30 '%s' | grep -A 10 '^ *source */usr/share/yunohost/helpers' | grep '^ *source ' | tail -n +2"
% self.path, % self.path,
shell=True, shell=True,
).decode("utf-8") ).decode("utf-8")