package/psplash: drop 'default n' for fullscreen mode
PATCH 1/3 package/psplash: drop 'default n' for fullscreen mode
Commit a028f0a51de0ed ("package/psplash: add support for fullscreen config option") added a 'default n' line to Config.in, but booleans default to 'n', so we typically do not add such redundant lines.
--- package/psplash/Config.in | 1 - 1 file changed, 1 deletion(-)
package/psplash/Config.in +0 -1
@@ -49,7 +49,6 @@ config BR2_PACKAGE_PSPLASH_STARTUP_MSG config BR2_PACKAGE_PSPLASH_FULL_SCREEN bool "use fullscreen mode" - default n help Enable displaying the psplash image in fullscreen mode.
Signature · 6 lines
2.39.5 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/3 package/pppd: drop 'default n' for cbcp option
Commit 53a302c6ed2a ("package/pppd: Add an option to enable/disable CBCP support.") added a 'default n' line to Config.in, but booleans default to 'n', so we typically do not add such redundant lines.
--- package/pppd/Config.in | 1 - 1 file changed, 1 deletion(-)
package/pppd/Config.in +0 -1
@@ -13,7 +13,6 @@ if BR2_PACKAGE_PPPD config BR2_PACKAGE_PPPD_CBCP bool "CBCP (Callback Control Protocol)" - default n help Enable Callback Control Protocol (CBCP) support in pppd. https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cbcp/.
Signature · 6 lines
2.39.5 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 3/3 utils/check-package: add a check for 'default n' in Config.in files
In reply to Peter KorsgaardBoolean Config.in symbols default to 'n', so we typically do not add such redundant lines.
--- utils/checkpackagelib/lib_config.py | 11 ++++++++ utils/checkpackagelib/test_lib_config.py | 33 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+)
utils/checkpackagelib/lib_config.py +11 -0
@@ -242,6 +242,17 @@ class Indent(_CheckFunction): text] +class NoDefaultN(_CheckFunction): + DEFAULTN = re.compile(r"^\tdefault n$") + + def check_line(self, lineno, text): + text_nocomments = text.split("#")[0].rstrip() + if self.DEFAULTN.match(text_nocomments): + return ["{}:{}: boolean symbols default to 'n', so 'default n' is redundant" + .format(self.filename, lineno), + text] + + class RedefinedConfig(_CheckFunction): CONFIG = re.compile(r"^\s*(menu|)config\s+(BR2_\w+)\b") IF = re.compile(r"^\s*if\s+([^#]*)\b")
utils/checkpackagelib/test_lib_config.py +33 -0
@@ -387,6 +387,39 @@ def test_Indent(testname, filename, string, expected): assert warnings == expected +NoDefaultN = [ + ('good example', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault y\n', + []), + ('default n', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault n\n', + [['any:2: boolean symbols default to \'n\', so \'default n\' is redundant', + '\tdefault n\n']]), + ('default n with comment', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault n # this is a comment\n', + [['any:2: boolean symbols default to \'n\', so \'default n\' is redundant', + '\tdefault n # this is a comment\n']]), + ('default n with trailing whitespace', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault n \t\n', + [['any:2: boolean symbols default to \'n\', so \'default n\' is redundant', + '\tdefault n \t\n']]) + ] + + [email protected]('testname,filename,string,expected', NoDefaultN) +def test_NoDefaultN(testname, filename, string, expected): + warnings = util.check_file(m.NoDefaultN, filename, string) + assert warnings == expected + + RedefinedConfig = [ ('no redefinition', 'any',
Signature · 6 lines
2.39.5 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 3/3] utils/check-package: add a check for 'default n' in Config.in files
Quoted 4 lines · Peter Korsgaard
Boolean Config.in symbols default to 'n', so we typically do not add such redundant lines.
Signed-off-by Peter Korsgaard <[email protected]>
Applied to 2025.02.x and 2025.08.x, thanks.
Regards,
Arnout
Quoted 61 lines
--- utils/checkpackagelib/lib_config.py | 11 ++++++++ utils/checkpackagelib/test_lib_config.py | 33 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+)utils/checkpackagelib/lib_config.py +11
-0@@ -242,6 +242,17 @@ class Indent(_CheckFunction): text] +class NoDefaultN(_CheckFunction): + DEFAULTN = re.compile(r"^\tdefault n$") + + def check_line(self, lineno, text): + text_nocomments = text.split("#")[0].rstrip() + if self.DEFAULTN.match(text_nocomments): + return ["{}:{}: boolean symbols default to 'n', so 'default n' is redundant" + .format(self.filename, lineno), + text] + + class RedefinedConfig(_CheckFunction): CONFIG = re.compile(r"^\s*(menu|)config\s+(BR2_\w+)\b") IF = re.compile(r"^\s*if\s+([^#]*)\b")utils/checkpackagelib/test_lib_config.py +26
-0@@ -387,6 +387,39 @@ def test_Indent(testname, filename, string, expected): assert warnings == expected +NoDefaultN = [ + ('good example', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault y\n', + []), + ('default n', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault n\n', + [['any:2: boolean symbols default to \'n\', so \'default n\' is redundant', + '\tdefault n\n']]), + ('default n with comment', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault n # this is a comment\n', + [['any:2: boolean symbols default to \'n\', so \'default n\' is redundant', + '\tdefault n # this is a comment\n']]), + ('default n with trailing whitespace', + 'any', + 'config BR2_PACKAGE_FOO\n' + '\tdefault n \t\n', + [['any:2: boolean symbols default to \'n\', so \'default n\' is redundant', + '\tdefault n \t\n']]) + ] +
utils/checkpackagelib/test_lib_config.py def test_Indent(testname, filename, string, expected): · line 425
Quoted 10 lines
utils/checkpackagelib/test_lib_config.py +7
-0+ [email protected]('testname,filename,string,expected', NoDefaultN) +def test_NoDefaultN(testname, filename, string, expected): + warnings = util.check_file(m.NoDefaultN, filename, string) + assert warnings == expected + + RedefinedConfig = [ ('no redefinition', 'any',
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 5 lines · Peter Korsgaard
Commit
a028f0a51de0ed("package/psplash: add support for fullscreen config option") added a 'default n' line to Config.in, but booleans default to 'n', so we typically do not add such redundant lines.Signed-off-by Peter Korsgaard <[email protected]>
Series applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 5 lines · Peter Korsgaard
Commit
a028f0a51de0ed("package/psplash: add support for fullscreen config option") added a 'default n' line to Config.in, but booleans default to 'n', so we typically do not add such redundant lines.Signed-off-by Peter Korsgaard <[email protected]>
Applied to 2025.08.x, thanks.
Regards,
Arnout
Quoted 9 lines
--- package/psplash/Config.in | 1 - 1 file changed, 1 deletion(-)package/psplash/Config.in +0
-0
package/psplash/Config.in config BR2_PACKAGE_PSPLASH_STARTUP_MSG · line 54
Quoted 7 lines
package/psplash/Config.in +0
-1@@ -49,7 +49,6 @@ config BR2_PACKAGE_PSPLASH_STARTUP_MSG config BR2_PACKAGE_PSPLASH_FULL_SCREEN bool "use fullscreen mode" - default n help Enable displaying the psplash image in fullscreen mode.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot