Skip to content

chore: ruff auto-fixes — collapsible-else-if, if-stmt-min-max, dict.fromkeys#23926

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:chore/complexity-phase1
May 11, 2026
Merged

chore: ruff auto-fixes — collapsible-else-if, if-stmt-min-max, dict.fromkeys#23926
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:chore/complexity-phase1

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of complexity refactoring — mechanical auto-fixes with zero logic changes.

Rule Count What
PLR5501 28 else: if:elif: — flattens nesting
PLR1730 15 if x < y: x = yx = max(x, y) (and min variants)
C420 2 dict comprehension → dict.fromkeys
PLR1704 1 reason loop var shadowing function param → err_msg
C414 1 sorted(list(x))sorted(x)

Test plan

  • 17,211 tests pass, zero regressions
  • All 28 files parse cleanly (ast.parse verified)
  • ruff check --select PLR5501,PLR1730,C420,PLR1704,C414 → zero remaining

Files

28 files, +223/-267 (-44 net)

…romkeys

PLR5501 (collapsible-else-if): 28 instances — else: if: → elif:
PLR1730 (if-stmt-min-max):   15 instances — if x<y: x=y → x=max(x,y)
C420   (dict.fromkeys):       2 instances — dictcomp → dict.fromkeys
PLR1704 (redefined-argument): 1 instance — reason → err_msg (shadow fix)
C414   (unnecessary-list):    1 instance — sorted(list(x)) → sorted(x)

28 files, -44 net lines. All mechanical, zero logic changes.
17,211 tests pass, zero regressions.
@kshitijk4poor kshitijk4poor merged commit 6578744 into NousResearch:main May 11, 2026
7 of 11 checks passed
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have labels May 11, 2026
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…romkeys (NousResearch#23926)

PLR5501 (collapsible-else-if): 28 instances — else: if: → elif:
PLR1730 (if-stmt-min-max):   15 instances — if x<y: x=y → x=max(x,y)
C420   (dict.fromkeys):       2 instances — dictcomp → dict.fromkeys
PLR1704 (redefined-argument): 1 instance — reason → err_msg (shadow fix)
C414   (unnecessary-list):    1 instance — sorted(list(x)) → sorted(x)

28 files, -44 net lines. All mechanical, zero logic changes.
17,211 tests pass, zero regressions.
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
…romkeys (NousResearch#23926)

PLR5501 (collapsible-else-if): 28 instances — else: if: → elif:
PLR1730 (if-stmt-min-max):   15 instances — if x<y: x=y → x=max(x,y)
C420   (dict.fromkeys):       2 instances — dictcomp → dict.fromkeys
PLR1704 (redefined-argument): 1 instance — reason → err_msg (shadow fix)
C414   (unnecessary-list):    1 instance — sorted(list(x)) → sorted(x)

28 files, -44 net lines. All mechanical, zero logic changes.
17,211 tests pass, zero regressions.
heybenn42 pushed a commit to heybenn42/hermes-agent that referenced this pull request May 15, 2026
* upstream/main: (1099 commits)
  chore: ruff auto-fix C401, C416, C408, PLR1722 (NousResearch#23940)
  feat(prompt-cache): cross-session 1h prefix cache for Claude on Anthropic / OpenRouter / Nous Portal (NousResearch#23828)
  chore: ruff auto-fix PLR6201 — tuple → set in membership tests (NousResearch#23937)
  chore(release): add AUTHOR_MAP entry for wuli666
  fix(auxiliary): evict async wrappers on poisoned client (follow-up to NousResearch#23482)
  fix(cli,tui): align CJK / wide-char markdown tables (NousResearch#23863)
  chore: ruff auto-fixes — collapsible-else-if, if-stmt-min-max, dict.fromkeys (NousResearch#23926)
  fix(/model): surface Nous Portal models from remote catalog manifest (NousResearch#23912)
  fix(cli): defensive _slash_confirm_state access + AUTHOR_MAP
  fix: use TUI modal for slash confirmations
  rebuild model catalog
  fix(dashboard): validate dist exists when --skip-build is set
  fix(dashboard): fallback to stale dist, retry build, add --skip-build flag
  chore: AUTHOR_MAP entry for VinceZcrikl noreply (NousResearch#23647)
  fix: make web UI build output decoding robust on Windows
  fix(agent): catch ChatGPT-account Codex data-URL rejection so images are stripped instead of cascading to compression (NousResearch#23602)
  revert: roll back /goal checklist + /subgoal feature stack (NousResearch#23813)
  chore: AUTHOR_MAP entries for sudo-hardening salvage contributors
  fix(approval): catch sudo with stdin/askpass/shell privilege flags
  fix(terminal): block sudo -S password guessing when SUDO_PASSWORD is not set
  ...
AlexFoxD pushed a commit to AlexFoxD/hermes-agent that referenced this pull request May 21, 2026
…romkeys (NousResearch#23926)

PLR5501 (collapsible-else-if): 28 instances — else: if: → elif:
PLR1730 (if-stmt-min-max):   15 instances — if x<y: x=y → x=max(x,y)
C420   (dict.fromkeys):       2 instances — dictcomp → dict.fromkeys
PLR1704 (redefined-argument): 1 instance — reason → err_msg (shadow fix)
C414   (unnecessary-list):    1 instance — sorted(list(x)) → sorted(x)

28 files, -44 net lines. All mechanical, zero logic changes.
17,211 tests pass, zero regressions.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…romkeys (NousResearch#23926)

PLR5501 (collapsible-else-if): 28 instances — else: if: → elif:
PLR1730 (if-stmt-min-max):   15 instances — if x<y: x=y → x=max(x,y)
C420   (dict.fromkeys):       2 instances — dictcomp → dict.fromkeys
PLR1704 (redefined-argument): 1 instance — reason → err_msg (shadow fix)
C414   (unnecessary-list):    1 instance — sorted(list(x)) → sorted(x)

28 files, -44 net lines. All mechanical, zero logic changes.
17,211 tests pass, zero regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants