| Age | Commit message (Collapse) | Author |
|
Just adds f66cd71 ("Allow "n"/"m"/"y" as aliases for 0/1/2 in
set_value()").
|
|
More experience working with the API convinced me that it's worth it.
Gets rid of ugly conversions in the menuconfig.py and oldconfig.py
examples, and streamlines some things internally as well.
Include two other small fixes as well:
- Make warnings generated by Choice.set_value() match those generated
by Symbol.set_value().
- Get rid of the input stripping in menuconfig.py. It's not like the
interface is usable as-is anyway, and it just complicates the
example.
|
|
Typing '??' displays the help text of the current item.
|
|
Not sure why anyone would want to oldconfig just a part of the
configuration tree, especially as there might be dependencies pointing
outside of it. Take a Kconfig object instead of a node.
|
|
The oldnoconfig operation needs to be rerun if the value of any symbol
changes, to catch cases where symbols depend on symbols defined after
them. Otherwise the earlier symbols will just get their default value
instead of being prompted for.
|
|
The examples had some leftovers from Kconfiglib 1.
|
|
Implements the standard 'make oldconfig' functionality, prompting the
user for the values of new symbols to update an old .config file.
This came up in
https://github.com/zephyrproject-rtos/zephyr/issues/5426.
|
|
Does a global search over all architectures in the kernel, which should
avoid false positives.
Referencing an undefined symbol in a particular architecture can be fine
in a Kconfig file that's shared by multiple architectures, but if the
symbol isn't defined by any architecture, it's likely to be an error (or
a potential cleanup).
|
|
List the ARCH/SRCARCH pairs that don't conform to the arch/$ARCH/Kconfig
pattern directly.
|
|
Don't think anything currently depends on it where it would matter for
the test suite, but might as well.
|
|
This release tightens up syntax checking and adds all the warnings
generated by the C implementation (plus a few extra ones), making
Kconfiglib more viable as a replacement for the C tools, rather than
just being an auxiliary library.
Syntax checking changes:
- a84848b ("Tighten up syntax checking")
- 8716316 ("Generate a parse error for extra tokens at EOL")
- 416083a ("Flag constant symbols where they're not allowed")
Warning changes:
- 9c309400 ("Add some post-parsing warnings")
- da0bfa3a ("Error out for malformed hex/int/string defaults")
- 5d2041a9 ("Add more choice type and prompt sanity checks")
- 67f825fc ("Warn if there's more than one help text")
- 990c780f ("Add some warnings related to selects and implies")
- 7432ade8 ("Warn if a symbol is defined with multiple types")
- 5eeea863 ("Improve int/hex sanity checking")
- ad94bb45 ("Sanity-check range values")
- e930c140 ("Warn if a symbol/choice has multiple prompts")
- 60d12911 ("Warn if help text is empty")
- d43d2e83 ("Warn if menuconfig statement has no prompt")
- 3db12f72 ("Warn if a choice symbol has defaults")
- 0eadd61c ("Warn if choice symbol has prompt outside choice")
Also includes various code nits.
|
|
Just to have clean output. The warnings themselves are accurate.
|
|
Defining a choice symbol in multiple places to add some properties to it
outside the choice seems to actually be done deliberately by MIPS, but
it's almost guaranteed to be an error if the definition(s) outside the
choice have a prompt (and so can be changed by the user there), so warn
for that.
|
|
Never has en affect.
|
|
Mirrors a warning in the C implementation.
|
|
The empty-help warning is pretty spammy at the moment.
|
|
Personal pet peeve. Should add a warning to the C implementation too.
|
|
Arrange by type, which works pretty neatly except for the pesky ranges
check. This also makes us do less work in the common BOOL/TRISTATE case.
Get rid of _check_select_imply_sanity().
|
|
More important stuff up front.
|
|
In a single location. Having multiple definitions with different prompts
is okay.
|
|
Must have a form compatible with the int/hex, like for defaults.
Also refactor a bit and use a single _int_hex_value_is_sane() helper.
Less duplication.
|
|
If a non-constant default is given, we can still check that it has the
right type.
Break out two int/hex value sanity checking functions.
|
|
|
|
Constant as well as undefined symbols lack menu nodes, so it's
sufficient to check 'nodes'.
|
|
Only bool and tristate symbols can select and be selected.
Also add docstrings to the sanity checking functions.
|
|
Mirrors a warning I added to the C implementation.
|
|
- Choices should have type bool or tristate
- Choice values should have a prompt
Also fix indentation mess-up.
|
|
Have separate functions for checking symbols and choices instead of
mixing them up. Easier to read, and avoids some isinstance() checks.
Add some comments too.
|
|
Instead of failing in more cryptic ways later.
Also use 'orig_type' instead of 'type' for the UNKNOWN check. Oversight.
|
|
These are easiest to check after parsing, since a symbol/choice can be
defined in multiple locations:
- Warn if a symbol or choice defined without a type. Also warn for
choice value symbols defined without a type, even if they
automatically get their type from the choice. This feature isn't
well-known and probably not used deliberately.
- Warn if a choice is defined without a prompt
- Warn of a choice default symbol is not contained in the choice
Also move _name_and_loc_str() from the symbol class to the global scope
and generalize it to be able to handle choices.
|
|
Helpful
|
|
Might break U-Boot if they ever upgrade Kconfiglib, because they have a
'select y' in there (which the C tools don't flag since they only look
for quotes), but it's a one-line fix.
|
|
Implicit submenus are only ever created with a symbol as the base.
_has_auto_menu_dep() would indirectly reject anything that wasn't a
symbol anyway, but it led to redundant work.
Also get rid of _check_auto_menu() and inline it into _finalize_tree().
It's easier to read without the recursive call being hidden inside
_check_auto_menu().
Tweak the comments a bit too.
|
|
Extra unconsumed tokens at the end of lines were previously ignored.
Better to flag it.
Also inline _next_token() and _peek_token() into the syntax checking
variants of _next_token(). This code is pretty hot, and it saves a few %
of parsing time.
|
|
|
|
- _saved_line already handles EOF automagically, so no need to
special-case it at the end of help text parsing.
- Check for EOF earlier in _next_line(). Bit silly to do it after line
joining.
|
|
Now points out the error for stuff like 'config' with no symbol name
following it instead of randomly failing later.
1-2% parsing performance hit tops it seems.
|
|
No need to repeat what's already in the README. Just refer to the GitHub
page.
Include some other minor tweaks to the introductory sections.
|
|
Shows up as a nice sidebar on PyPI.
|
|
Can test the python_requires now too.
|
|
No longer needed after 955ea4 ("Support <, > relational operators with
tristates").
|
|
|
|
It's also used for the warning added in 0087b40 ("Warn if a symbol with
unsatisfied deps is selected") now.
|
|
|
|
|
|
- 955ea4 ("Support <, > relational operators with tristates") adds a
small recent feature from upstream. Haven't even seen any relational
operators besides = and != being used yet I think.
- 8d7235 ("Tighten up regexes") cleans up and optimizes the regexes
used during parsing and .config reading a bit.
|
|
|
|
- Match the simpler strchr()y .config parsing done by the C
implementation
- Spell out \w as [a-zA-Z0-9_]. Easier to verify.
- Use ASCII mode for Python 3 to be consistent with Python 2,
where it's already the default. \s no longer matches obscure Unicode
stuff.
This also speeds up regex matching during parsing by about 15% on Python
3, increasing parsing performance by a few %. Looks like there's a tiny
improvement for Python 2 as well.
|
|
Mirrors 9059a3493ef ("kconfig: fix relational operators for bool and
tristate symbols") in the C implementation.
|
|
|