Access sections by both ID and name#531
Access sections by both ID and name#531centosinfra-prod-github-app[bot] merged 1 commit intomainfrom
Conversation
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 16s |
There was a problem hiding this comment.
Code Review
This pull request updates the Sections class to support lookups by both normalized ID and normalized name in the __contains__ and find methods. A new unit test has been added to verify this behavior. The review feedback suggests refining the __contains__ implementation to safely handle non-string inputs, such as Section objects, to avoid potential AttributeError exceptions when calling .lower().
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the Sections class in specfile/sections.py to allow checking for section existence and finding sections using both their normalized ID and normalized name. These changes are implemented in the contains and find methods. A new unit test, test_contains_and_getattr, has been added to verify the updated logic. Feedback was provided to remove a redundant type cast in the contains method for better consistency and readability.
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 13s |
Signed-off-by: Nikola Forró <nforro@redhat.com> Assisted-by: Claude Opus 4.6 via Claude Code Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 12s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 2m 08s |
Fixes #417.