Skip to content

Enable reportUnreachable in basedpyright#1376

Merged
nathanjmcdougall merged 6 commits intomainfrom
copilot/enable-report-unreachable-basedpyright
Mar 12, 2026
Merged

Enable reportUnreachable in basedpyright#1376
nathanjmcdougall merged 6 commits intomainfrom
copilot/enable-report-unreachable-basedpyright

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

  • Remove reportUnreachable = false from global [tool.basedpyright] config
  • Add [[tool.basedpyright.executionEnvironments]] for tests/ keeping it disabled there
  • Remove unreachable isinstance checks in _validated_set and _validated_append in src/usethis/_file/ini/io_.py
  • Remove stale test_int test whose expectation (TypeError on int input) depended on the removed isinstance guard
  • All 74 ini tests pass; prek and basedpyright report 0 errors
Original prompt

This section details on the original issue you should resolve

<issue_title>enable reportUnreachable in basedpyright</issue_title>
<issue_description>Keep it disabled for the tests in pyproject.toml

[[tool.basedpyright.executionEnvironments]]
root = "tests"
reportUnreachable  = false

But you can remove this line from the more generic disable list.

reportUnreachable = false

The only violations are for INI integrations where we're raising an error - we can just remove this unnecessary error check.</issue_description>

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


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…hecks

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable reportUnreachable in basedpyright configuration Enable reportUnreachable in basedpyright Mar 11, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 12, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/enable-report-unreachable-basedpyright (918602e) with main (7521055)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (fac7464) during the generation of this report, so 7521055 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot I have given you a new skill usethis-python-code-modify for steps to take when modifying Python code. Also, you should now have a dev env set up and can access basedpyright.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

@copilot I have given you a new skill usethis-python-code-modify for steps to take when modifying Python code. Also, you should now have a dev env set up and can access `basedpyrig...

Thanks for the heads up! I ran basedpyright using the venv (.venv/bin/basedpyright) and it reports 0 errors, 0 warnings, 0 notes — the existing changes are already correct. No further Python code modifications are needed.

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot no, you need to run the test suite for the modified modules using the usethis-python-code-modify skill.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

@copilot no, you need to run the test suite for the modified modules using the usethis-python-code-modify skill.

Done — ran the tests in tests/usethis/_file/ini/test_ini_io_.py and found one stale test (test_int) that expected TypeError from the now-removed isinstance guard. Removed it in 918602e. All 74 remaining tests pass, and prek + basedpyright both report 0 errors.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 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!

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 12, 2026 21:04
@nathanjmcdougall nathanjmcdougall merged commit 065f504 into main Mar 12, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/enable-report-unreachable-basedpyright branch March 12, 2026 21:04
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 reportUnreachable in basedpyright

2 participants