refactor(cli): simplify cli package#68
Merged
Merged
Conversation
- Remove dead NetBoxAPIError/NetBoxClientError catch in main() (already re-raised as typer.Exit by handlers) - Extract _resolve_ssl_and_timeout() to deduplicate verify_ssl/timeout logic shared by resolve_transport_settings and resolve_profile - Merge duplicate NoProfileError/UnknownProfileError branches in map_error() - Extract _out() helper in handlers.py to replace repeated stream-or-stdout ternary - Drop dead `raise` after refuse_unsupported_bulk (always raises) - Collapse `if value is None or not value` to `if not value` in _url_only() - Remove stale Phase 1 references from commands_dump.py docstring and help strings - Trim globals.__all__ to only the two symbols actually defined and imported from this module Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced May 12, 2026
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #51
Simplify pass on
nsc/cli/. No behaviour changes. All tests pass.Changes
app.py: Remove deadNetBoxAPIError/NetBoxClientErrorcatch inmain()— handlers already re-raise astyper.Exit, so this branch never fires. Drop now-unused import.runtime.py: Extract_resolve_ssl_and_timeout()to deduplicate the identical verify_ssl/timeout block duplicated betweenresolve_transport_settingsandresolve_profile. MergeNoProfileError/UnknownProfileErrorbranches inmap_error(). Collapse redundantif value is None or not valuetoif not valuein_url_only(). Remove stale "Task 12" reference from module docstring.handlers.py: Extract_out()helper for the repeatedstream if stream is not None else sys.stdoutternary (3 call sites). Drop deadraiseafterrefuse_unsupported_bulk()(always raises).globals.py: Trim__all__to the two symbols actually defined here; remove now-unused re-exported imports.commands_dump.py: Remove stale Phase 1 references from module docstring and option help strings.🤖 Generated with Claude Code