Refurb CLI
Refurb analyzes Python code and suggests focused improvements with rule identifiers, explanations and target-version awareness.
- 2,535 ★ on the repository
- Last commit
- GPL-3.0
Extended access
Why this level
- The analyzer reads project source and configuration; proposed edits need separate verification.
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/refurbDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The analyzer reads project source and configuration; proposed edits need separate verification.
This is third-party code. Review the repository files before installing.
What it does
Refurb finds Python expressions that can be simplified or modernized. Findings identify the file, location and rule, with explanations and examples available before edits. Rules can be configured by code, category, line or project. A target Python version constrains suggestions. Agents receive small candidate changes for separate review and testing.
Who it is for. Maintainers of older Python projects modernizing code through small, reviewable changes.
Good fit when
- A Python upgrade needs outdated patterns identified.
- Repeated expressions should be simplified under specific rules.
- The team wants a rule explanation before editing behavior.
- CI needs findings as GitHub annotations.
Not a fit when
- You need functional correctness proven without tests.
- Suggestions would be applied in bulk without version or context review.
- The main task is enforcing module architecture boundaries.
Example request
Check this package with Refurb targeting Python 3.10. Explain three findings and propose separate edits without applying them.Limitations
Refurb itself requires Python 3.10 or newer, though it can target Python 3.7 and later with an explicit setting. Without a target version it uses the local interpreter version, potentially differing from deployment or CI. Some checks are disabled by default, so coverage depends on configuration. Line ignores suppress findings and need deliberate review, especially when a bare noqa hides every rule on that line.
How to disable. Remove Refurb from CI or pre-commit and uninstall it. Previously accepted code edits remain.
FAQ
How do I explain a rule?
Run `refurb --explain FURB123` with the relevant code and compare examples to your case.
Can I target older Python?
Yes. Set `--python-version` as x.y while running Refurb on a supported interpreter.
How do I list enabled checks?
Use `--verbose` before assessing report coverage.
Can I suppress one rule?
Yes, with `--ignore` or a rule-specific noqa. Prefer a narrow, justified exception.
How do I emit GitHub annotations?
Set `--format github` and verify CI consumes the output.
Discussion
No questions or reviews yet.
Related
CLI toolsA code-review CLI and plugin for agents: reads a git diff and writes line-level comments with context
A local codebase index with ten MCP tools: dependency graph, git history, code health and architectural decisions without re-grepping on every step
Simplify Codebase
simplify-codebase
A skill that says prove first and delete after: finding accidental complexity in code and safe removal without breakage. The README is in Chinese
Code review grounded in classic engineering books: findings with source citations, severity labels and several analysis modes
A CLI opens diffs and documents in a terminal so a person can annotate lines and pass feedback to a coding agent
Methods for an agent in one CLI: comparing options, solving problems and changing code in steps, 20 slash commands in all.
README in short
Configuration supports categories and finding order. Advanced usage can pass arguments to the underlying Mypy analysis.