ruff 0.9.2__py3-none-linux_armv6l.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ruff/__init__.py ADDED
File without changes
ruff/__main__.py ADDED
@@ -0,0 +1,88 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import sys
5
+ import sysconfig
6
+
7
+
8
+ def find_ruff_bin() -> str:
9
+ """Return the ruff binary path."""
10
+
11
+ ruff_exe = "ruff" + sysconfig.get_config_var("EXE")
12
+
13
+ scripts_path = os.path.join(sysconfig.get_path("scripts"), ruff_exe)
14
+ if os.path.isfile(scripts_path):
15
+ return scripts_path
16
+
17
+ if sys.version_info >= (3, 10):
18
+ user_scheme = sysconfig.get_preferred_scheme("user")
19
+ elif os.name == "nt":
20
+ user_scheme = "nt_user"
21
+ elif sys.platform == "darwin" and sys._framework:
22
+ user_scheme = "osx_framework_user"
23
+ else:
24
+ user_scheme = "posix_user"
25
+
26
+ user_path = os.path.join(
27
+ sysconfig.get_path("scripts", scheme=user_scheme), ruff_exe
28
+ )
29
+ if os.path.isfile(user_path):
30
+ return user_path
31
+
32
+ # Search in `bin` adjacent to package root (as created by `pip install --target`).
33
+ pkg_root = os.path.dirname(os.path.dirname(__file__))
34
+ target_path = os.path.join(pkg_root, "bin", ruff_exe)
35
+ if os.path.isfile(target_path):
36
+ return target_path
37
+
38
+ # Search for pip-specific build environments.
39
+ #
40
+ # Expect to find ruff in <prefix>/pip-build-env-<rand>/overlay/bin/ruff
41
+ # Expect to find a "normal" folder at <prefix>/pip-build-env-<rand>/normal
42
+ #
43
+ # See: https://github.com/pypa/pip/blob/102d8187a1f5a4cd5de7a549fd8a9af34e89a54f/src/pip/_internal/build_env.py#L87
44
+ paths = os.environ.get("PATH", "").split(os.pathsep)
45
+ if len(paths) >= 2:
46
+
47
+ def get_last_three_path_parts(path: str) -> list[str]:
48
+ """Return a list of up to the last three parts of a path."""
49
+ parts = []
50
+
51
+ while len(parts) < 3:
52
+ head, tail = os.path.split(path)
53
+ if tail or head != path:
54
+ parts.append(tail)
55
+ path = head
56
+ else:
57
+ parts.append(path)
58
+ break
59
+
60
+ return parts
61
+
62
+ maybe_overlay = get_last_three_path_parts(paths[0])
63
+ maybe_normal = get_last_three_path_parts(paths[1])
64
+ if (
65
+ len(maybe_normal) >= 3
66
+ and maybe_normal[-1].startswith("pip-build-env-")
67
+ and maybe_normal[-2] == "normal"
68
+ and len(maybe_overlay) >= 3
69
+ and maybe_overlay[-1].startswith("pip-build-env-")
70
+ and maybe_overlay[-2] == "overlay"
71
+ ):
72
+ # The overlay must contain the ruff binary.
73
+ candidate = os.path.join(paths[0], ruff_exe)
74
+ if os.path.isfile(candidate):
75
+ return candidate
76
+
77
+ raise FileNotFoundError(scripts_path)
78
+
79
+
80
+ if __name__ == "__main__":
81
+ ruff = os.fsdecode(find_ruff_bin())
82
+ if sys.platform == "win32":
83
+ import subprocess
84
+
85
+ completed_process = subprocess.run([ruff, *sys.argv[1:]])
86
+ sys.exit(completed_process.returncode)
87
+ else:
88
+ os.execvp(ruff, [ruff, *sys.argv[1:]])
Binary file
@@ -0,0 +1,579 @@
1
+ Metadata-Version: 2.4
2
+ Name: ruff
3
+ Version: 0.9.2
4
+ Classifier: Development Status :: 5 - Production/Stable
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Rust
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ License-File: LICENSE
22
+ Summary: An extremely fast Python linter and code formatter, written in Rust.
23
+ Keywords: automation,flake8,pycodestyle,pyflakes,pylint,clippy
24
+ Home-Page: https://docs.astral.sh/ruff
25
+ Author: Charlie Marsh <charlie.r.marsh@gmail.com>
26
+ Author-email: "Astral Software Inc." <hey@astral.sh>
27
+ License: MIT
28
+ Requires-Python: >=3.7
29
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
30
+ Project-URL: Repository, https://github.com/astral-sh/ruff
31
+ Project-URL: Documentation, https://docs.astral.sh/ruff/
32
+ Project-URL: Changelog, https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md
33
+
34
+ <!-- Begin section: Overview -->
35
+
36
+ # Ruff
37
+
38
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
39
+ [![image](https://img.shields.io/pypi/v/ruff.svg)](https://pypi.python.org/pypi/ruff)
40
+ [![image](https://img.shields.io/pypi/l/ruff.svg)](https://github.com/astral-sh/ruff/blob/main/LICENSE)
41
+ [![image](https://img.shields.io/pypi/pyversions/ruff.svg)](https://pypi.python.org/pypi/ruff)
42
+ [![Actions status](https://github.com/astral-sh/ruff/workflows/CI/badge.svg)](https://github.com/astral-sh/ruff/actions)
43
+ [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.com/invite/astral-sh)
44
+
45
+ [**Docs**](https://docs.astral.sh/ruff/) | [**Playground**](https://play.ruff.rs/)
46
+
47
+ An extremely fast Python linter and code formatter, written in Rust.
48
+
49
+ <p align="center">
50
+ <img alt="Shows a bar chart with benchmark results." src="https://user-images.githubusercontent.com/1309177/232603516-4fb4892d-585c-4b20-b810-3db9161831e4.svg">
51
+ </p>
52
+
53
+ <p align="center">
54
+ <i>Linting the CPython codebase from scratch.</i>
55
+ </p>
56
+
57
+ - ⚡️ 10-100x faster than existing linters (like Flake8) and formatters (like Black)
58
+ - 🐍 Installable via `pip`
59
+ - 🛠️ `pyproject.toml` support
60
+ - 🤝 Python 3.13 compatibility
61
+ - ⚖️ Drop-in parity with [Flake8](https://docs.astral.sh/ruff/faq/#how-does-ruffs-linter-compare-to-flake8), isort, and [Black](https://docs.astral.sh/ruff/faq/#how-does-ruffs-formatter-compare-to-black)
62
+ - 📦 Built-in caching, to avoid re-analyzing unchanged files
63
+ - 🔧 Fix support, for automatic error correction (e.g., automatically remove unused imports)
64
+ - 📏 Over [800 built-in rules](https://docs.astral.sh/ruff/rules/), with native re-implementations
65
+ of popular Flake8 plugins, like flake8-bugbear
66
+ - ⌨️ First-party [editor integrations](https://docs.astral.sh/ruff/integrations/) for
67
+ [VS Code](https://github.com/astral-sh/ruff-vscode) and [more](https://docs.astral.sh/ruff/editors/setup)
68
+ - 🌎 Monorepo-friendly, with [hierarchical and cascading configuration](https://docs.astral.sh/ruff/configuration/#config-file-discovery)
69
+
70
+ Ruff aims to be orders of magnitude faster than alternative tools while integrating more
71
+ functionality behind a single, common interface.
72
+
73
+ Ruff can be used to replace [Flake8](https://pypi.org/project/flake8/) (plus dozens of plugins),
74
+ [Black](https://github.com/psf/black), [isort](https://pypi.org/project/isort/),
75
+ [pydocstyle](https://pypi.org/project/pydocstyle/), [pyupgrade](https://pypi.org/project/pyupgrade/),
76
+ [autoflake](https://pypi.org/project/autoflake/), and more, all while executing tens or hundreds of
77
+ times faster than any individual tool.
78
+
79
+ Ruff is extremely actively developed and used in major open-source projects like:
80
+
81
+ - [Apache Airflow](https://github.com/apache/airflow)
82
+ - [Apache Superset](https://github.com/apache/superset)
83
+ - [FastAPI](https://github.com/tiangolo/fastapi)
84
+ - [Hugging Face](https://github.com/huggingface/transformers)
85
+ - [Pandas](https://github.com/pandas-dev/pandas)
86
+ - [SciPy](https://github.com/scipy/scipy)
87
+
88
+ ...and [many more](#whos-using-ruff).
89
+
90
+ Ruff is backed by [Astral](https://astral.sh). Read the [launch post](https://astral.sh/blog/announcing-astral-the-company-behind-ruff),
91
+ or the original [project announcement](https://notes.crmarsh.com/python-tooling-could-be-much-much-faster).
92
+
93
+ ## Testimonials
94
+
95
+ [**Sebastián Ramírez**](https://twitter.com/tiangolo/status/1591912354882764802), creator
96
+ of [FastAPI](https://github.com/tiangolo/fastapi):
97
+
98
+ > Ruff is so fast that sometimes I add an intentional bug in the code just to confirm it's actually
99
+ > running and checking the code.
100
+
101
+ [**Nick Schrock**](https://twitter.com/schrockn/status/1612615862904827904), founder of [Elementl](https://www.elementl.com/),
102
+ co-creator of [GraphQL](https://graphql.org/):
103
+
104
+ > Why is Ruff a gamechanger? Primarily because it is nearly 1000x faster. Literally. Not a typo. On
105
+ > our largest module (dagster itself, 250k LOC) pylint takes about 2.5 minutes, parallelized across 4
106
+ > cores on my M1. Running ruff against our _entire_ codebase takes .4 seconds.
107
+
108
+ [**Bryan Van de Ven**](https://github.com/bokeh/bokeh/pull/12605), co-creator
109
+ of [Bokeh](https://github.com/bokeh/bokeh/), original author
110
+ of [Conda](https://docs.conda.io/en/latest/):
111
+
112
+ > Ruff is ~150-200x faster than flake8 on my machine, scanning the whole repo takes ~0.2s instead of
113
+ > ~20s. This is an enormous quality of life improvement for local dev. It's fast enough that I added
114
+ > it as an actual commit hook, which is terrific.
115
+
116
+ [**Timothy Crosley**](https://twitter.com/timothycrosley/status/1606420868514877440),
117
+ creator of [isort](https://github.com/PyCQA/isort):
118
+
119
+ > Just switched my first project to Ruff. Only one downside so far: it's so fast I couldn't believe
120
+ > it was working till I intentionally introduced some errors.
121
+
122
+ [**Tim Abbott**](https://github.com/astral-sh/ruff/issues/465#issuecomment-1317400028), lead
123
+ developer of [Zulip](https://github.com/zulip/zulip):
124
+
125
+ > This is just ridiculously fast... `ruff` is amazing.
126
+
127
+ <!-- End section: Overview -->
128
+
129
+ ## Table of Contents
130
+
131
+ For more, see the [documentation](https://docs.astral.sh/ruff/).
132
+
133
+ 1. [Getting Started](#getting-started)
134
+ 1. [Configuration](#configuration)
135
+ 1. [Rules](#rules)
136
+ 1. [Contributing](#contributing)
137
+ 1. [Support](#support)
138
+ 1. [Acknowledgements](#acknowledgements)
139
+ 1. [Who's Using Ruff?](#whos-using-ruff)
140
+ 1. [License](#license)
141
+
142
+ ## Getting Started<a id="getting-started"></a>
143
+
144
+ For more, see the [documentation](https://docs.astral.sh/ruff/).
145
+
146
+ ### Installation
147
+
148
+ Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI.
149
+
150
+ Invoke Ruff directly with [`uvx`](https://docs.astral.sh/uv/):
151
+
152
+ ```shell
153
+ uvx ruff check # Lint all files in the current directory.
154
+ uvx ruff format # Format all files in the current directory.
155
+ ```
156
+
157
+ Or install Ruff with `uv` (recommended), `pip`, or `pipx`:
158
+
159
+ ```shell
160
+ # With uv.
161
+ uv tool install ruff@latest # Install Ruff globally.
162
+ uv add --dev ruff # Or add Ruff to your project.
163
+
164
+ # With pip.
165
+ pip install ruff
166
+
167
+ # With pipx.
168
+ pipx install ruff
169
+ ```
170
+
171
+ Starting with version `0.5.0`, Ruff can be installed with our standalone installers:
172
+
173
+ ```shell
174
+ # On macOS and Linux.
175
+ curl -LsSf https://astral.sh/ruff/install.sh | sh
176
+
177
+ # On Windows.
178
+ powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
179
+
180
+ # For a specific version.
181
+ curl -LsSf https://astral.sh/ruff/0.9.2/install.sh | sh
182
+ powershell -c "irm https://astral.sh/ruff/0.9.2/install.ps1 | iex"
183
+ ```
184
+
185
+ You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
186
+ and with [a variety of other package managers](https://docs.astral.sh/ruff/installation/).
187
+
188
+ ### Usage
189
+
190
+ To run Ruff as a linter, try any of the following:
191
+
192
+ ```shell
193
+ ruff check # Lint all files in the current directory (and any subdirectories).
194
+ ruff check path/to/code/ # Lint all files in `/path/to/code` (and any subdirectories).
195
+ ruff check path/to/code/*.py # Lint all `.py` files in `/path/to/code`.
196
+ ruff check path/to/code/to/file.py # Lint `file.py`.
197
+ ruff check @arguments.txt # Lint using an input file, treating its contents as newline-delimited command-line arguments.
198
+ ```
199
+
200
+ Or, to run Ruff as a formatter:
201
+
202
+ ```shell
203
+ ruff format # Format all files in the current directory (and any subdirectories).
204
+ ruff format path/to/code/ # Format all files in `/path/to/code` (and any subdirectories).
205
+ ruff format path/to/code/*.py # Format all `.py` files in `/path/to/code`.
206
+ ruff format path/to/code/to/file.py # Format `file.py`.
207
+ ruff format @arguments.txt # Format using an input file, treating its contents as newline-delimited command-line arguments.
208
+ ```
209
+
210
+ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff-pre-commit`](https://github.com/astral-sh/ruff-pre-commit):
211
+
212
+ ```yaml
213
+ - repo: https://github.com/astral-sh/ruff-pre-commit
214
+ # Ruff version.
215
+ rev: v0.9.2
216
+ hooks:
217
+ # Run the linter.
218
+ - id: ruff
219
+ args: [ --fix ]
220
+ # Run the formatter.
221
+ - id: ruff-format
222
+ ```
223
+
224
+ Ruff can also be used as a [VS Code extension](https://github.com/astral-sh/ruff-vscode) or with [various other editors](https://docs.astral.sh/ruff/editors/setup).
225
+
226
+ Ruff can also be used as a [GitHub Action](https://github.com/features/actions) via
227
+ [`ruff-action`](https://github.com/astral-sh/ruff-action):
228
+
229
+ ```yaml
230
+ name: Ruff
231
+ on: [ push, pull_request ]
232
+ jobs:
233
+ ruff:
234
+ runs-on: ubuntu-latest
235
+ steps:
236
+ - uses: actions/checkout@v4
237
+ - uses: astral-sh/ruff-action@v3
238
+ ```
239
+
240
+ ### Configuration<a id="configuration"></a>
241
+
242
+ Ruff can be configured through a `pyproject.toml`, `ruff.toml`, or `.ruff.toml` file (see:
243
+ [_Configuration_](https://docs.astral.sh/ruff/configuration/), or [_Settings_](https://docs.astral.sh/ruff/settings/)
244
+ for a complete list of all configuration options).
245
+
246
+ If left unspecified, Ruff's default configuration is equivalent to the following `ruff.toml` file:
247
+
248
+ ```toml
249
+ # Exclude a variety of commonly ignored directories.
250
+ exclude = [
251
+ ".bzr",
252
+ ".direnv",
253
+ ".eggs",
254
+ ".git",
255
+ ".git-rewrite",
256
+ ".hg",
257
+ ".ipynb_checkpoints",
258
+ ".mypy_cache",
259
+ ".nox",
260
+ ".pants.d",
261
+ ".pyenv",
262
+ ".pytest_cache",
263
+ ".pytype",
264
+ ".ruff_cache",
265
+ ".svn",
266
+ ".tox",
267
+ ".venv",
268
+ ".vscode",
269
+ "__pypackages__",
270
+ "_build",
271
+ "buck-out",
272
+ "build",
273
+ "dist",
274
+ "node_modules",
275
+ "site-packages",
276
+ "venv",
277
+ ]
278
+
279
+ # Same as Black.
280
+ line-length = 88
281
+ indent-width = 4
282
+
283
+ # Assume Python 3.9
284
+ target-version = "py39"
285
+
286
+ [lint]
287
+ # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
288
+ select = ["E4", "E7", "E9", "F"]
289
+ ignore = []
290
+
291
+ # Allow fix for all enabled rules (when `--fix`) is provided.
292
+ fixable = ["ALL"]
293
+ unfixable = []
294
+
295
+ # Allow unused variables when underscore-prefixed.
296
+ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
297
+
298
+ [format]
299
+ # Like Black, use double quotes for strings.
300
+ quote-style = "double"
301
+
302
+ # Like Black, indent with spaces, rather than tabs.
303
+ indent-style = "space"
304
+
305
+ # Like Black, respect magic trailing commas.
306
+ skip-magic-trailing-comma = false
307
+
308
+ # Like Black, automatically detect the appropriate line ending.
309
+ line-ending = "auto"
310
+ ```
311
+
312
+ Note that, in a `pyproject.toml`, each section header should be prefixed with `tool.ruff`. For
313
+ example, `[lint]` should be replaced with `[tool.ruff.lint]`.
314
+
315
+ Some configuration options can be provided via dedicated command-line arguments, such as those
316
+ related to rule enablement and disablement, file discovery, and logging level:
317
+
318
+ ```shell
319
+ ruff check --select F401 --select F403 --quiet
320
+ ```
321
+
322
+ The remaining configuration options can be provided through a catch-all `--config` argument:
323
+
324
+ ```shell
325
+ ruff check --config "lint.per-file-ignores = {'some_file.py' = ['F841']}"
326
+ ```
327
+
328
+ To opt in to the latest lint rules, formatter style changes, interface updates, and more, enable
329
+ [preview mode](https://docs.astral.sh/ruff/rules/) by setting `preview = true` in your configuration
330
+ file or passing `--preview` on the command line. Preview mode enables a collection of unstable
331
+ features that may change prior to stabilization.
332
+
333
+ See `ruff help` for more on Ruff's top-level commands, or `ruff help check` and `ruff help format`
334
+ for more on the linting and formatting commands, respectively.
335
+
336
+ ## Rules<a id="rules"></a>
337
+
338
+ <!-- Begin section: Rules -->
339
+
340
+ **Ruff supports over 800 lint rules**, many of which are inspired by popular tools like Flake8,
341
+ isort, pyupgrade, and others. Regardless of the rule's origin, Ruff re-implements every rule in
342
+ Rust as a first-party feature.
343
+
344
+ By default, Ruff enables Flake8's `F` rules, along with a subset of the `E` rules, omitting any
345
+ stylistic rules that overlap with the use of a formatter, like `ruff format` or
346
+ [Black](https://github.com/psf/black).
347
+
348
+ If you're just getting started with Ruff, **the default rule set is a great place to start**: it
349
+ catches a wide variety of common errors (like unused imports) with zero configuration.
350
+
351
+ <!-- End section: Rules -->
352
+
353
+ Beyond the defaults, Ruff re-implements some of the most popular Flake8 plugins and related code
354
+ quality tools, including:
355
+
356
+ - [autoflake](https://pypi.org/project/autoflake/)
357
+ - [eradicate](https://pypi.org/project/eradicate/)
358
+ - [flake8-2020](https://pypi.org/project/flake8-2020/)
359
+ - [flake8-annotations](https://pypi.org/project/flake8-annotations/)
360
+ - [flake8-async](https://pypi.org/project/flake8-async)
361
+ - [flake8-bandit](https://pypi.org/project/flake8-bandit/) ([#1646](https://github.com/astral-sh/ruff/issues/1646))
362
+ - [flake8-blind-except](https://pypi.org/project/flake8-blind-except/)
363
+ - [flake8-boolean-trap](https://pypi.org/project/flake8-boolean-trap/)
364
+ - [flake8-bugbear](https://pypi.org/project/flake8-bugbear/)
365
+ - [flake8-builtins](https://pypi.org/project/flake8-builtins/)
366
+ - [flake8-commas](https://pypi.org/project/flake8-commas/)
367
+ - [flake8-comprehensions](https://pypi.org/project/flake8-comprehensions/)
368
+ - [flake8-copyright](https://pypi.org/project/flake8-copyright/)
369
+ - [flake8-datetimez](https://pypi.org/project/flake8-datetimez/)
370
+ - [flake8-debugger](https://pypi.org/project/flake8-debugger/)
371
+ - [flake8-django](https://pypi.org/project/flake8-django/)
372
+ - [flake8-docstrings](https://pypi.org/project/flake8-docstrings/)
373
+ - [flake8-eradicate](https://pypi.org/project/flake8-eradicate/)
374
+ - [flake8-errmsg](https://pypi.org/project/flake8-errmsg/)
375
+ - [flake8-executable](https://pypi.org/project/flake8-executable/)
376
+ - [flake8-future-annotations](https://pypi.org/project/flake8-future-annotations/)
377
+ - [flake8-gettext](https://pypi.org/project/flake8-gettext/)
378
+ - [flake8-implicit-str-concat](https://pypi.org/project/flake8-implicit-str-concat/)
379
+ - [flake8-import-conventions](https://github.com/joaopalmeiro/flake8-import-conventions)
380
+ - [flake8-logging](https://pypi.org/project/flake8-logging/)
381
+ - [flake8-logging-format](https://pypi.org/project/flake8-logging-format/)
382
+ - [flake8-no-pep420](https://pypi.org/project/flake8-no-pep420)
383
+ - [flake8-pie](https://pypi.org/project/flake8-pie/)
384
+ - [flake8-print](https://pypi.org/project/flake8-print/)
385
+ - [flake8-pyi](https://pypi.org/project/flake8-pyi/)
386
+ - [flake8-pytest-style](https://pypi.org/project/flake8-pytest-style/)
387
+ - [flake8-quotes](https://pypi.org/project/flake8-quotes/)
388
+ - [flake8-raise](https://pypi.org/project/flake8-raise/)
389
+ - [flake8-return](https://pypi.org/project/flake8-return/)
390
+ - [flake8-self](https://pypi.org/project/flake8-self/)
391
+ - [flake8-simplify](https://pypi.org/project/flake8-simplify/)
392
+ - [flake8-slots](https://pypi.org/project/flake8-slots/)
393
+ - [flake8-super](https://pypi.org/project/flake8-super/)
394
+ - [flake8-tidy-imports](https://pypi.org/project/flake8-tidy-imports/)
395
+ - [flake8-todos](https://pypi.org/project/flake8-todos/)
396
+ - [flake8-type-checking](https://pypi.org/project/flake8-type-checking/)
397
+ - [flake8-use-pathlib](https://pypi.org/project/flake8-use-pathlib/)
398
+ - [flynt](https://pypi.org/project/flynt/) ([#2102](https://github.com/astral-sh/ruff/issues/2102))
399
+ - [isort](https://pypi.org/project/isort/)
400
+ - [mccabe](https://pypi.org/project/mccabe/)
401
+ - [pandas-vet](https://pypi.org/project/pandas-vet/)
402
+ - [pep8-naming](https://pypi.org/project/pep8-naming/)
403
+ - [pydocstyle](https://pypi.org/project/pydocstyle/)
404
+ - [pygrep-hooks](https://github.com/pre-commit/pygrep-hooks)
405
+ - [pylint-airflow](https://pypi.org/project/pylint-airflow/)
406
+ - [pyupgrade](https://pypi.org/project/pyupgrade/)
407
+ - [tryceratops](https://pypi.org/project/tryceratops/)
408
+ - [yesqa](https://pypi.org/project/yesqa/)
409
+
410
+ For a complete enumeration of the supported rules, see [_Rules_](https://docs.astral.sh/ruff/rules/).
411
+
412
+ ## Contributing<a id="contributing"></a>
413
+
414
+ Contributions are welcome and highly appreciated. To get started, check out the
415
+ [**contributing guidelines**](https://docs.astral.sh/ruff/contributing/).
416
+
417
+ You can also join us on [**Discord**](https://discord.com/invite/astral-sh).
418
+
419
+ ## Support<a id="support"></a>
420
+
421
+ Having trouble? Check out the existing issues on [**GitHub**](https://github.com/astral-sh/ruff/issues),
422
+ or feel free to [**open a new one**](https://github.com/astral-sh/ruff/issues/new).
423
+
424
+ You can also ask for help on [**Discord**](https://discord.com/invite/astral-sh).
425
+
426
+ ## Acknowledgements<a id="acknowledgements"></a>
427
+
428
+ Ruff's linter draws on both the APIs and implementation details of many other
429
+ tools in the Python ecosystem, especially [Flake8](https://github.com/PyCQA/flake8), [Pyflakes](https://github.com/PyCQA/pyflakes),
430
+ [pycodestyle](https://github.com/PyCQA/pycodestyle), [pydocstyle](https://github.com/PyCQA/pydocstyle),
431
+ [pyupgrade](https://github.com/asottile/pyupgrade), and [isort](https://github.com/PyCQA/isort).
432
+
433
+ In some cases, Ruff includes a "direct" Rust port of the corresponding tool.
434
+ We're grateful to the maintainers of these tools for their work, and for all
435
+ the value they've provided to the Python community.
436
+
437
+ Ruff's formatter is built on a fork of Rome's [`rome_formatter`](https://github.com/rome/tools/tree/main/crates/rome_formatter),
438
+ and again draws on both API and implementation details from [Rome](https://github.com/rome/tools),
439
+ [Prettier](https://github.com/prettier/prettier), and [Black](https://github.com/psf/black).
440
+
441
+ Ruff's import resolver is based on the import resolution algorithm from [Pyright](https://github.com/microsoft/pyright).
442
+
443
+ Ruff is also influenced by a number of tools outside the Python ecosystem, like
444
+ [Clippy](https://github.com/rust-lang/rust-clippy) and [ESLint](https://github.com/eslint/eslint).
445
+
446
+ Ruff is the beneficiary of a large number of [contributors](https://github.com/astral-sh/ruff/graphs/contributors).
447
+
448
+ Ruff is released under the MIT license.
449
+
450
+ ## Who's Using Ruff?<a id="whos-using-ruff"></a>
451
+
452
+ Ruff is used by a number of major open-source projects and companies, including:
453
+
454
+ - [Albumentations](https://github.com/albumentations-team/albumentations)
455
+ - Amazon ([AWS SAM](https://github.com/aws/serverless-application-model))
456
+ - Anthropic ([Python SDK](https://github.com/anthropics/anthropic-sdk-python))
457
+ - [Apache Airflow](https://github.com/apache/airflow)
458
+ - AstraZeneca ([Magnus](https://github.com/AstraZeneca/magnus-core))
459
+ - [Babel](https://github.com/python-babel/babel)
460
+ - Benchling ([Refac](https://github.com/benchling/refac))
461
+ - [Bokeh](https://github.com/bokeh/bokeh)
462
+ - CrowdCent ([NumerBlox](https://github.com/crowdcent/numerblox)) <!-- typos: ignore -->
463
+ - [Cryptography (PyCA)](https://github.com/pyca/cryptography)
464
+ - CERN ([Indico](https://getindico.io/))
465
+ - [DVC](https://github.com/iterative/dvc)
466
+ - [Dagger](https://github.com/dagger/dagger)
467
+ - [Dagster](https://github.com/dagster-io/dagster)
468
+ - Databricks ([MLflow](https://github.com/mlflow/mlflow))
469
+ - [Dify](https://github.com/langgenius/dify)
470
+ - [FastAPI](https://github.com/tiangolo/fastapi)
471
+ - [Godot](https://github.com/godotengine/godot)
472
+ - [Gradio](https://github.com/gradio-app/gradio)
473
+ - [Great Expectations](https://github.com/great-expectations/great_expectations)
474
+ - [HTTPX](https://github.com/encode/httpx)
475
+ - [Hatch](https://github.com/pypa/hatch)
476
+ - [Home Assistant](https://github.com/home-assistant/core)
477
+ - Hugging Face ([Transformers](https://github.com/huggingface/transformers),
478
+ [Datasets](https://github.com/huggingface/datasets),
479
+ [Diffusers](https://github.com/huggingface/diffusers))
480
+ - IBM ([Qiskit](https://github.com/Qiskit/qiskit))
481
+ - ING Bank ([popmon](https://github.com/ing-bank/popmon), [probatus](https://github.com/ing-bank/probatus))
482
+ - [Ibis](https://github.com/ibis-project/ibis)
483
+ - [ivy](https://github.com/unifyai/ivy)
484
+ - [Jupyter](https://github.com/jupyter-server/jupyter_server)
485
+ - [Kraken Tech](https://kraken.tech/)
486
+ - [LangChain](https://github.com/hwchase17/langchain)
487
+ - [Litestar](https://litestar.dev/)
488
+ - [LlamaIndex](https://github.com/jerryjliu/llama_index)
489
+ - Matrix ([Synapse](https://github.com/matrix-org/synapse))
490
+ - [MegaLinter](https://github.com/oxsecurity/megalinter)
491
+ - Meltano ([Meltano CLI](https://github.com/meltano/meltano), [Singer SDK](https://github.com/meltano/sdk))
492
+ - Microsoft ([Semantic Kernel](https://github.com/microsoft/semantic-kernel),
493
+ [ONNX Runtime](https://github.com/microsoft/onnxruntime),
494
+ [LightGBM](https://github.com/microsoft/LightGBM))
495
+ - Modern Treasury ([Python SDK](https://github.com/Modern-Treasury/modern-treasury-python))
496
+ - Mozilla ([Firefox](https://github.com/mozilla/gecko-dev))
497
+ - [Mypy](https://github.com/python/mypy)
498
+ - [Nautobot](https://github.com/nautobot/nautobot)
499
+ - Netflix ([Dispatch](https://github.com/Netflix/dispatch))
500
+ - [Neon](https://github.com/neondatabase/neon)
501
+ - [Nokia](https://nokia.com/)
502
+ - [NoneBot](https://github.com/nonebot/nonebot2)
503
+ - [NumPyro](https://github.com/pyro-ppl/numpyro)
504
+ - [ONNX](https://github.com/onnx/onnx)
505
+ - [OpenBB](https://github.com/OpenBB-finance/OpenBBTerminal)
506
+ - [Open Wine Components](https://github.com/Open-Wine-Components/umu-launcher)
507
+ - [PDM](https://github.com/pdm-project/pdm)
508
+ - [PaddlePaddle](https://github.com/PaddlePaddle/Paddle)
509
+ - [Pandas](https://github.com/pandas-dev/pandas)
510
+ - [Pillow](https://github.com/python-pillow/Pillow)
511
+ - [Poetry](https://github.com/python-poetry/poetry)
512
+ - [Polars](https://github.com/pola-rs/polars)
513
+ - [PostHog](https://github.com/PostHog/posthog)
514
+ - Prefect ([Python SDK](https://github.com/PrefectHQ/prefect), [Marvin](https://github.com/PrefectHQ/marvin))
515
+ - [PyInstaller](https://github.com/pyinstaller/pyinstaller)
516
+ - [PyMC](https://github.com/pymc-devs/pymc/)
517
+ - [PyMC-Marketing](https://github.com/pymc-labs/pymc-marketing)
518
+ - [pytest](https://github.com/pytest-dev/pytest)
519
+ - [PyTorch](https://github.com/pytorch/pytorch)
520
+ - [Pydantic](https://github.com/pydantic/pydantic)
521
+ - [Pylint](https://github.com/PyCQA/pylint)
522
+ - [PyVista](https://github.com/pyvista/pyvista)
523
+ - [Reflex](https://github.com/reflex-dev/reflex)
524
+ - [River](https://github.com/online-ml/river)
525
+ - [Rippling](https://rippling.com)
526
+ - [Robyn](https://github.com/sansyrox/robyn)
527
+ - [Saleor](https://github.com/saleor/saleor)
528
+ - Scale AI ([Launch SDK](https://github.com/scaleapi/launch-python-client))
529
+ - [SciPy](https://github.com/scipy/scipy)
530
+ - Snowflake ([SnowCLI](https://github.com/Snowflake-Labs/snowcli))
531
+ - [Sphinx](https://github.com/sphinx-doc/sphinx)
532
+ - [Stable Baselines3](https://github.com/DLR-RM/stable-baselines3)
533
+ - [Starlette](https://github.com/encode/starlette)
534
+ - [Streamlit](https://github.com/streamlit/streamlit)
535
+ - [The Algorithms](https://github.com/TheAlgorithms/Python)
536
+ - [Vega-Altair](https://github.com/altair-viz/altair)
537
+ - WordPress ([Openverse](https://github.com/WordPress/openverse))
538
+ - [ZenML](https://github.com/zenml-io/zenml)
539
+ - [Zulip](https://github.com/zulip/zulip)
540
+ - [build (PyPA)](https://github.com/pypa/build)
541
+ - [cibuildwheel (PyPA)](https://github.com/pypa/cibuildwheel)
542
+ - [delta-rs](https://github.com/delta-io/delta-rs)
543
+ - [featuretools](https://github.com/alteryx/featuretools)
544
+ - [meson-python](https://github.com/mesonbuild/meson-python)
545
+ - [nox](https://github.com/wntrblm/nox)
546
+ - [pip](https://github.com/pypa/pip)
547
+
548
+ ### Show Your Support
549
+
550
+ If you're using Ruff, consider adding the Ruff badge to your project's `README.md`:
551
+
552
+ ```md
553
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
554
+ ```
555
+
556
+ ...or `README.rst`:
557
+
558
+ ```rst
559
+ .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
560
+ :target: https://github.com/astral-sh/ruff
561
+ :alt: Ruff
562
+ ```
563
+
564
+ ...or, as HTML:
565
+
566
+ ```html
567
+ <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;"></a>
568
+ ```
569
+
570
+ ## License<a id="license"></a>
571
+
572
+ This repository is licensed under the [MIT License](https://github.com/astral-sh/ruff/blob/main/LICENSE)
573
+
574
+ <div align="center">
575
+ <a target="_blank" href="https://astral.sh" style="background:none">
576
+ <img src="https://raw.githubusercontent.com/astral-sh/ruff/main/assets/svg/Astral.svg" alt="Made by Astral">
577
+ </a>
578
+ </div>
579
+