Skip to content

Enable reportUnnecessaryComparison in basedpyright#1399

Merged
nathanjmcdougall merged 2 commits intomainfrom
copilot/enable-report-unnecessary-comparison
Mar 13, 2026
Merged

Enable reportUnnecessaryComparison in basedpyright#1399
nathanjmcdougall merged 2 commits intomainfrom
copilot/enable-report-unnecessary-comparison

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

Enables the reportUnnecessaryComparison basedpyright rule and removes the dead code/redundant conditions it surfaces.

Changes

  • pyproject.toml: Remove reportUnnecessaryComparison = false override.
  • _core/readme.py: get_project_name() returns str, never None — simplify the content-building branches, removing two dead elif/else arms.
  • bitbucket/pipeweld.py: ParallelItem.parallel is typed as non-optional Parallel — remove four if item.parallel is not None: guards and dedent the inner logic.
  • bitbucket/steps.py: StepItem.step: Step and Step1.step: Step2 are non-optional — remove two redundant if ... is not None filters from list comprehensions.
# Before — item.parallel is Parallel, never None
if item.parallel is not None:
    if isinstance(item.parallel.root, schema.ParallelSteps):
        ...

# After
if isinstance(item.parallel.root, schema.ParallelSteps):
    ...

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://mirrors.aliyun.com/pypi/packages/70/1b/4273d02565a4e86f238e9fee23e6c5c3bb7b5c237c63228e1b72451db224/uv-0.9.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
    • Triggering command: /home/REDACTED/work/usethis-python/usethis-python/.venv/bin/prek prek run -a ps (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>enable reportUnnecessaryComparison in basedpyright</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

@nathanjmcdougall We should be able to remove unnecessary conditions and/or dead code by complying with this rule.

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add enable reportUnnecessaryComparison in basedpyright Enable reportUnnecessaryComparison in basedpyright Mar 13, 2026
Copilot AI requested a review from nathanjmcdougall March 13, 2026 00:48
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 13, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/enable-report-unnecessary-comparison (f01722a) with main (2d06cad)

Open in CodSpeed

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 13, 2026 03:15
@nathanjmcdougall nathanjmcdougall merged commit 81ae429 into main Mar 13, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/enable-report-unnecessary-comparison branch March 13, 2026 03: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.

enable reportUnnecessaryComparison in basedpyright

2 participants