mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
[PR #1391] [MERGED] Lint Python code with ruff #1999
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/google/brotli/pull/1391
Author: @cclauss
Created: 11/19/2025
Status: ✅ Merged
Merged: 11/20/2025
Merged by: @copybara-service[bot]
Base:
master← Head:ruff📝 Commits (1)
52ad34cLint Python code with ruff📊 Changes
2 files changed (+7 additions, -1 deletions)
View changed files
📝
.github/workflows/lint.yml(+6 -1)📝
research/brotlidump.py(+1 -0)📄 Description
An extremely fast Python linter and code formatter, written in Rust. -- https://docs.astral.sh/ruff
%
ruff check --statistics%
ruff check --ignore=E701,E741,F401,F841%
ruff rule F841unused-variable (F841)
Derived from the Pyflakes linter.
Fix is sometimes available.
What it does
Checks for the presence of unused variables in function scopes.
Why is this bad?
A variable that is defined but not used is likely a mistake, and should
be removed to avoid confusion.
If a variable is intentionally defined-but-not-used, it should be
prefixed with an underscore, or some other value that adheres to the
[
lint.dummy-variable-rgx] pattern.Example
Use instead:
Fix safety
This rule's fix is marked as unsafe because removing an unused variable assignment may
delete comments that are attached to the assignment.
See also
This rule does not apply to bindings in unpacked assignments (e.g.
x, y = 1, 2). Seeunused-unpacked-variablefor this case.Options
lint.dummy-variable-rgx🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.