Skip to content

Conversation

@uweber
Copy link

@uweber uweber commented Dec 8, 2025

added in 6.17 with f9afce4f32e9


Summary by cubic

Adds support for a "transitional" attribute in Kconfiglib to help migrate config names while hiding legacy symbols from users. Adds token, parsing, and API exposure to mark items as transitional.

  • New Features

    • Parse the "transitional" keyword and set item.is_transitional.
    • Expose is_transitional on Symbol and include it in repr.
    • Add lexer token and keyword mapping for "transitional".
  • Migration

    • Mark legacy symbols with "transitional" and default the new symbol to the old (e.g., FEATURE defaults to FEATURE_OLD).

Written for commit 9ab3694. Summary will update automatically on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="kconfiglib.py">

<violation number="1" location="kconfiglib.py:5545">
P1: Missing initialization for `is_transitional` in `Choice.__init__()`. The attribute is added to `__slots__` and accessed in `__repr__`, but unlike `is_optional` which is initialized to `False`, `is_transitional` is never initialized. This will cause `AttributeError` when accessing any Choice object that doesn&#39;t have the `transitional` keyword.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

added in 6.17 with f9afce4f32e9

Signed-off-by: Ulrich Weber <[email protected]>
@jserv
Copy link
Contributor

jserv commented Dec 8, 2025

Regression reported by CI:

Run Kconfiglib/tests/reltest python
  Kconfiglib/tests/reltest python
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.12.12/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.12/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.12/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.12/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.12/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.12/x64/lib

================= Test suite with python =================

Traceback (most recent call last):
  File "/home/runner/work/Kconfiglib/Kconfiglib/Kconfiglib/testsuite.py", line 3692, in <module>
Testing string literal lexing
    run_tests()
  File "/home/runner/work/Kconfiglib/Kconfiglib/Kconfiglib/testsuite.py", line 120, in run_tests
    run_selftests()
  File "/home/runner/work/Kconfiglib/Kconfiglib/Kconfiglib/testsuite.py", line 1032, in run_selftests
    verify_repr(
  File "/home/runner/work/Kconfiglib/Kconfiglib/Kconfiglib/testsuite.py", line 932, in verify_repr
    verify_equal(repr(item) + "\n", s[1:])
Testing escape() and unescape()
Testing _ordered_unique()
Testing expression evaluation
Testing Symbol.__str__()/custom_str() and def_{int,hex,string}
Testing Choice.__str__()/custom_str()
Testing MenuNode.__str__()/custom_str() for menus and comments
Testing {MenuNode,Symbol,Choice}.orig_*
Testing Symbol.__repr__()
Testing Choice.__repr__()
                 ^^^^^^^^^^
  File "/home/runner/work/Kconfiglib/Kconfiglib/Kconfiglib/kconfiglib.py", line 5740, in __repr__
    if self.is_transitional:
       ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Choice' object has no attribute 'is_transitional'
test suite failed for python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants