summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-08Make 3.0.0 releasev3.0.0Ulf Magnusson
- Only includes e8b4ecb ("Don't special-case user_value for choice symbols set to y"). Since that's a tiny change to the behavior of the API, the major version is bumped.
2018-02-08Don't special-case user_value for choice symbols set to yUlf Magnusson
Previously, setting a choice symbol to y would only update user_selection on the parent choice and not the symbol's own user_value. Now both are updated. The point of the old behavior was to remember the m mode selections of a choice when it was switched back and forth between m and y mode, which was a feature I thought the C implementation had. On closer inspection, the C implementation never had that feature, though it might appear like it if you only make "lucky" changes (if you never select any symbols in y mode that were n in m mode). The new behavior is simpler and easier to understand: Symbol.user_value now always matches the value assigned in a .config file or via set_value(), provided the value was well-formed. This might avoid some special-casing in scripts too. The loss in usability is pretty minimal.
2018-02-08oldconfig.py comment nitUlf Magnusson
2018-02-08Prompt for choices with new visible symbols in oldconfig.pyUlf Magnusson
It makes sense to prompt for a choice during oldconfig if it contains new visible symbols, even if there is already an old visible user selection.
2018-02-07Add back omitted $ARCH != $SRCARCH defconfig testsUlf Magnusson
Oversight during refactoring. defconfig files should be searched for in in arch/$SRCARCH/ rather than arch/$ARCH/, to account for $ARCH != $SRCARCH. Adds a few tests to test_defconfig(). Some of the ARCH/defconfig combinations might be nonsensical, but that's fine. Make all test functions take $SRCARCH as well as $ARCH, which makes the implementation straightforward.
2018-02-07Give symbol locations in merge_config.py warningsUlf Magnusson
Helpful for debugging. Piggyback some small fixes: - Don't imply that merge_config.py is an executable file or that it only runs under Python 3. Remove the hashbang line and fix the example in the overview. - Add some #'s to the overview .config files that had accidentally been left out. - Fix a questionable sentence in oldconfig.py's name_and_loc_str() docstring.
2018-02-07Make 2.7.0 releasev2.7.0Ulf Magnusson
Just adds f66cd71 ("Allow "n"/"m"/"y" as aliases for 0/1/2 in set_value()").
2018-02-07Allow "n"/"m"/"y" as aliases for 0/1/2 in set_value()Ulf Magnusson
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.
2018-02-06Add help text display feature to oldconfig.pyUlf Magnusson
Typing '??' displays the help text of the current item.
2018-02-06Refactor do_oldconfig() slightlyUlf Magnusson
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.
2018-02-06Account for earlier symbols depending on later ones in oldconfig.pyUlf Magnusson
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.
2018-02-06Consistently use 'kconf' instead of 'conf'Ulf Magnusson
The examples had some leftovers from Kconfiglib 1.
2018-02-06Add oldconfig.py example scriptUlf Magnusson
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.
2018-02-03Add example that finds references to undefined symbolsUlf Magnusson
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).
2018-02-03Refactor test suite arch Kconfig loadingUlf Magnusson
List the ARCH/SRCARCH pairs that don't conform to the arch/$ARCH/Kconfig pattern directly.
2018-02-03Set $KERNELVERSION properly in test suiteUlf Magnusson
Don't think anything currently depends on it where it would matter for the test suite, but might as well.
2018-01-30Make 2.6.0 releasev2.6.0Ulf Magnusson
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.
2018-01-30Fix warnings printed for test suiteUlf Magnusson
Just to have clean output. The warnings themselves are accurate.
2018-01-30Warn if choice symbol has prompt outside choiceUlf Magnusson
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.
2018-01-29Warn if a choice symbol has defaultsUlf Magnusson
Never has en affect.
2018-01-29Warn if menuconfig statement has no promptUlf Magnusson
Mirrors a warning in the C implementation.
2018-01-29Give tip about getting rid of warningsUlf Magnusson
The empty-help warning is pretty spammy at the moment.
2018-01-29Warn if help text is emptyUlf Magnusson
Personal pet peeve. Should add a warning to the C implementation too.
2018-01-29Refactor _check_sym_sanity()Ulf Magnusson
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().
2018-01-29Move sym.ranges check to end of _check_sym_sanity()Ulf Magnusson
More important stuff up front.
2018-01-29Warn if a symbol/choice has multiple promptsUlf Magnusson
In a single location. Having multiple definitions with different prompts is okay.
2018-01-29Sanity-check range valuesUlf Magnusson
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.
2018-01-29Improve int/hex sanity checkingUlf Magnusson
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.
2018-01-28Warn if a symbol is defined with multiple typesUlf Magnusson
2018-01-28Remove redundant is_constant checkUlf Magnusson
Constant as well as undefined symbols lack menu nodes, so it's sufficient to check 'nodes'.
2018-01-28Add some warnings related to selects and impliesUlf Magnusson
Only bool and tristate symbols can select and be selected. Also add docstrings to the sanity checking functions.
2018-01-28Warn if there's more than one help textUlf Magnusson
Mirrors a warning I added to the C implementation.
2018-01-28Add more choice type and prompt sanity checksUlf Magnusson
- Choices should have type bool or tristate - Choice values should have a prompt Also fix indentation mess-up.
2018-01-28Refactor post-parsing sanity checkingUlf Magnusson
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.
2018-01-28Error out for malformed hex/int/string defaultsUlf Magnusson
Instead of failing in more cryptic ways later. Also use 'orig_type' instead of 'type' for the UNKNOWN check. Oversight.
2018-01-28Add some post-parsing warningsUlf Magnusson
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.
2018-01-28Give symbol definition location(s) in warningsUlf Magnusson
Helpful
2018-01-28Flag constant symbols where they're not allowedUlf Magnusson
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.
2018-01-28Only check for implicit submenus for symbolsUlf Magnusson
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.
2018-01-27Generate a parse error for extra tokens at EOLUlf Magnusson
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.
2018-01-27Parse error consistency nitUlf Magnusson
2018-01-27Simplify help text parsing and _next_line()Ulf Magnusson
- _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.
2018-01-27Tighten up syntax checkingUlf Magnusson
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.
2018-01-26Remove long overview from kconfiglib.pyUlf Magnusson
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.
2018-01-26Add project_urls to setup.pyUlf Magnusson
Shows up as a nice sidebar on PyPI.
2018-01-26Clean up setup.py a bitUlf Magnusson
Can test the python_requires now too.
2018-01-26Remove BOOL and TRISTATE from _TYPE_TO_BASEUlf Magnusson
No longer needed after 955ea4 ("Support <, > relational operators with tristates").
2018-01-25Add note re. custom output formatsUlf Magnusson
2018-01-25direct_dep documentation nitUlf Magnusson
It's also used for the warning added in 0087b40 ("Warn if a symbol with unsatisfied deps is selected") now.
2018-01-25Formatting nitUlf Magnusson