From 6cc1b2f3302205a883195ab7dfca4e46060ef883 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 25 Nov 2020 02:11:26 +0100 Subject: [PATCH] Report is_public default value being a string --- package_linter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package_linter.py b/package_linter.py index 0517984..d893a53 100755 --- a/package_linter.py +++ b/package_linter.py @@ -984,6 +984,10 @@ class Manifest(TestSuite): "The type '%s' for argument '%s' is not recognized... " "it probably doesn't behave as you expect ? Choose among those instead : %s" % (argument["type"], argument["name"], ', '.join(recognized_types)) ) + elif argument["type"] == "boolean" and argument.get("default", True) not in [True, False]: + yield Warning( + "Default value for boolean-type arguments should be a boolean... (in particular, make sure it's not a string!)" + ) if "choices" in argument.keys(): choices = [c.lower() for c in argument["choices"]]