Skip to content

Use ruff format#2901

Merged
Kludex merged 1 commit intoencode:masterfrom
karpetrosyan:switch-to-ruff-formater
Nov 2, 2023
Merged

Use ruff format#2901
Kludex merged 1 commit intoencode:masterfrom
karpetrosyan:switch-to-ruff-formater

Conversation

@karpetrosyan
Copy link
Contributor

Ruff introduced a new formatter that can completely replace black, allowing us to use ruff instead of ruff + black.

Ruff formatter, like ruff linter, is extremely fast.

@karpetrosyan karpetrosyan requested a review from a team October 25, 2023 06:17
@Kludex
Copy link
Contributor

Kludex commented Oct 25, 2023

Announcement: https://astral.sh/blog/the-ruff-formatter

Copy link
Contributor

@musale musale left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@Kludex Kludex added the do not merge PRs that should not be merged label Oct 26, 2023
@karpetrosyan karpetrosyan requested a review from zanieb October 27, 2023 08:50
Copy link
Contributor

@Kludex Kludex left a comment

Choose a reason for hiding this comment

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

Change to 88 back, please. At least let's discuss first.

Also, what's the time black takes to format httpx?

@Kludex Kludex removed the do not merge PRs that should not be merged label Oct 27, 2023
@karpetrosyan
Copy link
Contributor Author

Change to 88 back, please. At least let's discuss first.

It was 120 originally, and I just reverted that change 😕 .

Also, what's the time black takes to format httpx?

I don't think it matters; we just have an opportunity to get rid of the extra dependency.

@Kludex
Copy link
Contributor

Kludex commented Oct 27, 2023

Change to 88 back, please. At least let's discuss first.

It was 120 originally, and I just reverted that change 😕 .

It was 120 on linting... It was 88 on format.

@karpetrosyan
Copy link
Contributor Author

karpetrosyan commented Oct 27, 2023

It was 120 on linting... It was 88 on format.
Change to 88 back, please. At least let's discuss first.

How do you want me to do it? Both the formatter and the linter have a single line length. I'm not sure what the "change back to 88" even means here.

Setting the formatter line length equal to the linter line length feels more natural to me.

@karpetrosyan karpetrosyan force-pushed the switch-to-ruff-formater branch from e399490 to f9d2b86 Compare November 2, 2023 07:24
@karpetrosyan
Copy link
Contributor Author

Okay, I used the solution that @T-256 suggested, which was to use the max-line-length provided by the pycodestyle settings to keep this pull request as simple as possible.

Later, I'll start a discussion about enforcing limits to the same number.

@Kludex Kludex merged commit 1b7f39e into encode:master Nov 2, 2023
samclearman pushed a commit to titanmsp/httpx that referenced this pull request Apr 26, 2025
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.

6 participants