Skip to content

Use ruff format - #2901

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

Kludex merged 1 commit into
encode:masterfrom
karpetrosyan:switch-to-ruff-formater

Conversation

@karpetrosyan

Copy link
Copy Markdown
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.

Comment thread pyproject.toml Resolved
@karpetrosyan
karpetrosyan requested a review from a team October 25, 2023 06:17
@Kludex

Kludex commented Oct 25, 2023

Copy link
Copy Markdown
Contributor

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

Comment thread scripts/check Resolved

@musale musale left a comment

Copy link
Copy Markdown
Contributor

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
Comment thread pyproject.toml Resolved
@karpetrosyan
karpetrosyan requested a review from zanieb October 27, 2023 08:50

@Kludex Kludex left a comment •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Kludex commented Oct 27, 2023

Copy link
Copy Markdown
Contributor

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

karpetrosyan commented Oct 27, 2023 •

Copy link
Copy Markdown
Contributor Author

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.

Comment thread requirements.txt Resolved
@karpetrosyan
karpetrosyan force-pushed the switch-to-ruff-formater branch from e399490 to f9d2b86 Compare November 2, 2023 07:24
@karpetrosyan

Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

6 participants