Skip to content

Conversation

@phanirithvij
Copy link
Contributor

closes #891

if command.startswith("ruff"):
return [
(
rf"(?<=--> {re.escape(relative_path)}:)\d+"
Copy link
Contributor Author

@phanirithvij phanirithvij Sep 13, 2025

Choose a reason for hiding this comment

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

I am a bit confused what's required here.

I tried rf"(?<=\s+--> {re.escape(relative_path)}:)\d+" but it fails because re.PatternError: look-behind requires fixed-width pattern. so \s+ is not allowed.

I saw both _--> and __--> in the ruff tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for your fix

I'm not sure what you mean here, sorry - did you figure out a fix?

)

# simple dedent of '\s+-->'
out = "\n".join(sorted([x.lstrip() for x in output]))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so I am doing lstrip here to handle arbitrary indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my fix for the above issue is here.

Copy link
Collaborator

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

sure, no objections, thanks

@MarcoGorelli MarcoGorelli merged commit d497836 into nbQA-dev:main Oct 31, 2025
8 checks passed
@phanirithvij phanirithvij deleted the ruff-fmt-change branch October 31, 2025 21:26
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.

ruff output format changes in 0.12.10

2 participants