From df2d26fecd4d70232ae85beb813bc36d593c8bd1 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 15 Mar 2019 17:05:18 +0100 Subject: Warn for unquoted argument to 'source', etc. Print a warning suggesting to add quotes for things like source foo/bar/Kconfig menu title prompt unquoted Example warning: Kconfig:32: warning: style: quotes recommended around 'lib/Kconfig.debug' in 'source lib/Kconfig.debug' That quoteless syntax is supported for compatibility with old versions of the C tools. It only works for a single word. --- kconfiglib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kconfiglib.py b/kconfiglib.py index 60c8eaa..9d4ebd7 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2084,6 +2084,14 @@ class Kconfig(object): # tristate unquoted_prompt # # endmenu + # + # Named choices ('choice FOO') also end up here. + + if token is not _T_CHOICE: + self._warn("style: quotes recommended around '{}' in '{}'" + .format(name, self._line.strip()), + self._filename, self._linenr) + token = name i = match.end() -- cgit v1.2.3