Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing unit tests for # noqa:-like cases #16659

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Mar 12, 2025

Summary

Follow-up to #16483.

This case is explicitly described in the specification, but it is not covered by any tests:

We expect a list of rule codes, separated by commas or whitespace. After splitting first on commas, and then on whitespace, we attempt to parse each item in turn. If parsing a nonempty item returns no rule codes, we stop. If no codes were found at all we warn the user with MissingCodes.

Test Plan

Unit tests.

@InSyncWithFoo InSyncWithFoo changed the title [red-knot] mypy_primer: comment on PRs (#16599) Add missing unit tests for # noqa:-like cases Mar 12, 2025
Copy link

codspeed-hq bot commented Mar 12, 2025

CodSpeed Performance Report

Merging #16659 will degrade performances by 10.81%

Comparing InSyncWithFoo:noqa (7e7add7) with micha/ruff-0.10 (b8f1284)

Summary

❌ 1 regressions
✅ 31 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
red_knot_check_file[incremental] 4.9 ms 5.5 ms -10.81%

Copy link
Contributor

github-actions bot commented Mar 12, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Glad they passed 😄

@dylwil3 dylwil3 merged commit 948435d into astral-sh:micha/ruff-0.10 Mar 12, 2025
20 of 21 checks passed
@InSyncWithFoo InSyncWithFoo deleted the noqa branch March 12, 2025 13:19
dylwil3 pushed a commit that referenced this pull request Mar 12, 2025
## Summary

Follow-up to #16659.

This change adds tests for these three cases, which are (also) not
covered by existing tests:

* `# noqa: A` (lone incomplete code)
* `# noqa: A123, B` (complete codes, last one incomplete)
* `# noqa: A123B` (squashed codes, last one incomplete)
MichaReiser pushed a commit that referenced this pull request Mar 13, 2025
## Summary

Follow-up to #16659.

This change adds tests for these three cases, which are (also) not
covered by existing tests:

* `# noqa: A` (lone incomplete code)
* `# noqa: A123, B` (complete codes, last one incomplete)
* `# noqa: A123B` (squashed codes, last one incomplete)
MichaReiser pushed a commit that referenced this pull request Mar 13, 2025
## Summary

Follow-up to #16659.

This change adds tests for these three cases, which are (also) not
covered by existing tests:

* `# noqa: A` (lone incomplete code)
* `# noqa: A123, B` (complete codes, last one incomplete)
* `# noqa: A123B` (squashed codes, last one incomplete)
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