Find noqa comments on the right line after form feeds and other separators - #366
Merged
Merged
Conversation
…ators skip_import cut the import's lines out of str.splitlines(), which also splits on \f, \v, \x1c, \x85, U+2028 and others. One of those inside a string literal shifted every following line, so a `# noqa` import could be removed. Only \r\n, \r and \n end a line for the parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019P9bvuGwAyVCNUdsAYPB1V
hakancelikdev
pushed a commit
that referenced
this pull request
Oct 2, 2026
- Bump the version to 1.5.0 in the package, action.yml and the GitHub Action docs. - Date the changelog section and add entries for #362, #366 and #367. - Use an SPDX license expression (MIT) and license-files instead of the deprecated license table and classifier; requires setuptools>=77. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019P9bvuGwAyVCNUdsAYPB1V
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.
From the core-dev review of
claude/integration. The bug also exists onmain.Problem
skip_importtook the import's lines fromself.source.splitlines().str.splitlines()also splits on\f,\v,\x1c–\x1e,\x85, U+2028 and U+2029, but the parser, and therefore AST line numbers, only ends lines on\r\n,\rand\n. One of those characters inside a string literal shifted every following line:Fix
Split on
\r\n|\r|\nonly.Tests
test_skip_comment_line_after_other_line_separatorsis parametrized over 5 separators, and all 5 fail before this change. Full suite passes on 3.9 / 3.12 / 3.14, and pre-commit passes.🤖 Generated with Claude Code
https://claude.ai/code/session_019P9bvuGwAyVCNUdsAYPB1V
Generated by Claude Code