mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Recommend to add --quiet when using raw systemclt enable/disable
This commit is contained in:
parent
d66362f08f
commit
c1f2bfe536
1 changed files with 11 additions and 0 deletions
|
@ -1141,6 +1141,17 @@ class Script(TestSuite):
|
|||
"and should be avoided at all cost. Use 'reload' instead."
|
||||
)
|
||||
|
||||
@test()
|
||||
def quiet_systemctl_enable(self):
|
||||
|
||||
systemctl_enable = [line
|
||||
for line in [' '.join(line) for line in self.lines]
|
||||
if re.search(r"systemctl.*(enable|disable)", line)]
|
||||
|
||||
if any("-q" not in cmd for cmd in systemctl_enable):
|
||||
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(only=["install"])
|
||||
def argument_fetching(self):
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue