diff --git a/package_linter.py b/package_linter.py index ebb5879..0517984 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1152,6 +1152,17 @@ class Script(TestSuite): message = "Please add --quiet to systemctl enable/disable commands to avoid unecessary warnings when the script runs" yield Warning(message) if self.name in ["_common.sh", "install"] else Info(message) + @test() + def quiet_wget(self): + + wget_cmds = [line + for line in [' '.join(line) for line in self.lines] + if re.search(r"^wget ", line)] + + if any(" -q " not in cmd and "--quiet" not in cmd and "2>" not in cmd for cmd in wget_cmds): + message = "Please redirect wget's stderr to stdout with 2>&1 to avoid unecessary warnings when the script runs (yes, wget is annoying and displays a warning even when things are going okay >_> ...)" + yield Warning(message) if self.name in ["_common.sh", "install"] else Info(message) + @test(only=["install"]) def argument_fetching(self):