Skip to content

Avoid + operator to concatenate collections#826

Merged
ogenstad merged 1 commit intoinfrahub-developfrom
pog-RUF005
Feb 17, 2026
Merged

Avoid + operator to concatenate collections#826
ogenstad merged 1 commit intoinfrahub-developfrom
pog-RUF005

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Feb 16, 2026

Why

Minor linting fix to remove rule from exceptions

What changed

Avoid + operator to concatenate collections and instead use a single collection, probably trivial performance gains.

Summary by CodeRabbit

  • Refactor
    • Improved internal code style by modernizing list construction syntax across multiple modules.

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This pull request refactors list construction syntax across multiple files in the infrahub\_sdk package. List concatenation operations using the \+ operator are replaced with unpacking syntax using the \* operator. Changes are made in node.py, protocols\_generator.py, spec/object.py, topological\_sort.py, and utils.py. Additionally, the RUF005 rule is removed from the Ruff ignore list in pyproject.toml to enforce this syntactic pattern. The functional behavior and control flow remain unchanged across all modifications.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: replacing the + operator for collection concatenation with unpacking syntax.
Description check ✅ Passed The pull request description is minimal but covers the essential points: it's a linting fix that removes RUF005 from exceptions and replaces + operator usage with unpacking.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into infrahub-develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/utils.py 50.00% 1 Missing ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop     #826      +/-   ##
====================================================
+ Coverage             80.57%   80.59%   +0.01%     
====================================================
  Files                   118      118              
  Lines                 10235    10235              
  Branches               1538     1538              
====================================================
+ Hits                   8247     8249       +2     
+ Misses                 1457     1456       -1     
+ Partials                531      530       -1     
Flag Coverage Δ
integration-tests 40.40% <12.50%> (+<0.01%) ⬆️
python-3.10 51.79% <87.50%> (ø)
python-3.11 51.81% <87.50%> (+0.01%) ⬆️
python-3.12 51.79% <87.50%> (ø)
python-3.13 51.81% <87.50%> (+0.01%) ⬆️
python-3.14 53.48% <87.50%> (ø)
python-filler-3.12 23.97% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/node/node.py 85.67% <100.00%> (ø)
infrahub_sdk/protocols_generator/generator.py 95.00% <100.00%> (ø)
infrahub_sdk/spec/object.py 85.19% <ø> (ø)
infrahub_sdk/topological_sort.py 91.83% <100.00%> (ø)
infrahub_sdk/utils.py 88.47% <50.00%> (+0.92%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ogenstad ogenstad marked this pull request as ready for review February 16, 2026 09:53
@ogenstad ogenstad requested a review from a team as a code owner February 16, 2026 09:53
@ogenstad ogenstad merged commit e1ad3d7 into infrahub-develop Feb 17, 2026
21 checks passed
@ogenstad ogenstad deleted the pog-RUF005 branch February 17, 2026 07:16
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