summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-03-15 17:05:18 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2019-03-16 08:30:14 +0100
commitdf2d26fecd4d70232ae85beb813bc36d593c8bd1 (patch)
treee157175e88e2f2e02b52b5a99701eab6b6fd6ab1
parent57fd6c0375490dad70743b3857020aa2ae5bc2c8 (diff)
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.
-rw-r--r--kconfiglib.py8
1 files changed, 8 insertions, 0 deletions
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()