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

Match Black's formatting of trailing comments containing NBSP #7030

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

cnpryer
Copy link
Contributor

@cnpryer cnpryer commented Aug 31, 2023

Summary

I noticed the following isn't aligned between the formatter and black:

Before this change:

type:

# Input: \u{a0}\u{a0}type
i = ""  #  type: Add space before two leading NBSP

# Ruff: \u{a0}type
i = ""  #  type: Add space before two leading NBSP

# Black: \u{a0}\u{a0}type
i = ""  #   type: Add space before two leading NBSP

other

# Input: #\u{a0}\u{a0}noqa
i = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"  #  noqa

# Black: # \u{a0}noqa
i = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"  #  noqa

# Ruff: # noqa
i = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"  # noqa

Test Plan

Current fixtures

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 31, 2023

CodSpeed Performance Report

Merging #7030 will degrade performances by 3.38%

Comparing cnpryer:nbsp (35071c8) with main (68f605e)

Summary

❌ 1 regressions
✅ 19 untouched benchmarks

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

Benchmarks breakdown

Benchmark main cnpryer:nbsp Change
linter/default-rules[pydantic/types.py] 38.2 ms 39.5 ms -3.38%

@cnpryer cnpryer marked this pull request as ready for review September 1, 2023 11:03
@MichaReiser MichaReiser merged commit 0489bbc into astral-sh:main Sep 1, 2023
16 checks passed
@MichaReiser MichaReiser added the formatter Related to the formatter label Sep 1, 2023
@cnpryer cnpryer deleted the nbsp branch September 1, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants