Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Comments

Always write empty fixes on Ruff >= 0.1.6#319

Merged
charliermarsh merged 1 commit intomainfrom
charlie/empty
Nov 10, 2023
Merged

Always write empty fixes on Ruff >= 0.1.6#319
charliermarsh merged 1 commit intomainfrom
charlie/empty

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Nov 10, 2023

Summary

We can avoid the safeguard we introduced in #317 for newer Ruff versions, since Ruff will now avoid writing empty output for excluded files (see: astral-sh/ruff#8596).

Closes #267.

Test Plan

I tested this with a local debug build. Now, when I "Fix all" on a non-excluded file with import os, it does properly get removed, while running "Format" or "Fix all" on an excluded file leaves the contents untouched.

VERSION_REQUIREMENT_FORMATTER = SpecifierSet(">=0.0.291,<0.2.0")
VERSION_REQUIREMENT_LINTER = SpecifierSet(">=0.0.189,<0.2.0")
# Version requirement for use of the "ALL" rule selector
VERSION_REQUIREMENT_ALL_SELECTOR = SpecifierSet(">=0.0.198,<0.2.0")
Copy link
Member Author

Choose a reason for hiding this comment

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

Turns out this is now unused.

@charliermarsh charliermarsh added the bug Something isn't working label Nov 10, 2023
@charliermarsh charliermarsh changed the title Always write empty fixes on Ruff >= 0.1.5 Always write empty fixes on Ruff >= 0.1.6 Nov 10, 2023
@charliermarsh charliermarsh force-pushed the charlie/empty branch 2 times, most recently from fb4e633 to 99469b0 Compare November 10, 2023 04:42
@charliermarsh charliermarsh merged commit 0edc51e into main Nov 10, 2023
@charliermarsh charliermarsh deleted the charlie/empty branch November 10, 2023 04:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatting and "Fix All" doesn't work if it removes entire file content

2 participants