./devel/py-ruff, Extremely fast Python linter, written in Rust

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 0.4.2, Package name: py311-ruff-0.4.2, Maintainer: pkgsrc-users

Ruff is an extremely fast Python linter, written in Rust.

Ruff aims to be orders of magnitude faster than alternative tools
while integrating more functionality behind a single, common
interface.

Ruff can be used to replace Flake8 (plus dozens of plugins), isort,
pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while
executing tens or hundreds of times faster than any individual
tool.


Master sites:

Filesize: 2260.401 KB

Version history: (Expand)


CVS history: (Expand)


   2024-04-26 09:26:31 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-ruff: updated to 0.4.2

v0.4.2

Rule changes

[flake8-pyi] Allow for overloaded __exit__ and __aexit__ definitions (PYI036)
[pyupgrade] Catch usages of "%s" % var and provide an unsafe fix (UP031)
[refurb] Implement new rule that suggests min/max over sorted() (FURB192)

Server

Fix an issue with missing diagnostics for Neovim and Helix
Implement hover documentation for noqa codes
Introduce common Ruff configuration options with new server settings

Bug fixes

Use macos-12 for building release wheels to enable macOS 11 compatibility
[flake8-blind-expect] Allow raise from in BLE001
[flake8-pyi] Allow simple assignments to None in enum class scopes (PYI026)
[flake8-simplify] Avoid raising SIM911 for non-zip attribute calls
[refurb] Avoid operator.itemgetter suggestion for single-item tuple
[ruff] Respect per-file-ignores for RUF100 with no other diagnostics
[ruff] Fix async comprehension false positive (RUF029)

Documentation

[flake8-bugbear] Document explicitly disabling strict zip (B905)
[flake8-type-checking] Mention lint.typing-modules in TCH001, TCH002, and TCH003
[isort] Improve documentation around custom isort sections
[pylint] Fix documentation oversight for invalid-X-returns

Performance

Use matchit to resolve per-file settings
   2024-04-19 21:43:59 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-ruff: updated to 0.4.1

v0.4.1

Changes

Preview features

[pylint] Implement invalid-hash-returned (PLE0309)
[pylint] Implement invalid-index-returned (PLE0305)

Bug fixes

[pylint] Allow NoReturn-like functions for __str__, __len__, etc. (PLE0307)
Parser: Use empty range when there's "gap" in token source
[ruff] Ignore stub functions in unused-async (RUF029)
Parser: Expect indented case block instead of match stmt
   2024-04-19 11:12:07 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-ruff: updated to 0.4.0

0.4.0

A new, hand-written parser

Ruff's new parser is >2x faster, which translates to a 20-40% speedup for all \ 
linting and formatting invocations. There's a lot to say about this exciting \ 
change, so check out the blog post for more details!

A new language server in Rust

With this release, we also want to highlight our new language server. ruff \ 
server is a Rust-powered language server that comes built-in with Ruff. It can \ 
be used with any editor that supports the Language Server Protocol (LSP). It \ 
uses a multi-threaded, lock-free architecture inspired by rust-analyzer and it \ 
will open the door for a lot of exciting features. It’s also faster than our \ 
previous Python-based language server -- but you probably guessed that already.

ruff server is only in alpha, but it has a lot of features that you can try out \ 
today:

Lints Python files automatically and shows quick-fixes when available
Formats Python files, with support for range formatting
Comes with commands for quickly performing actions: ruff.applyAutofix, \ 
ruff.applyFormat, and ruff.applyOrganizeImports
Supports source.fixAll and source.organizeImports source actions
Automatically reloads your project configuration when you change it
To setup ruff server with your editor, refer to the README.md.

Preview features

[pycodestyle] Do not trigger E3 rules on defs following a function/method with a \ 
dummy body
[pylint] Implement invalid-bytes-returned (E0308)
[pylint] Implement invalid-length-returned (E0303)
[pylint] Implement self-cls-assignment (W0642)
[pylint] Omit stubs from invalid-bool and invalid-str-return-type
[ruff] New rule unused-async (RUF029) to detect unneeded async keywords on functions

Rule changes

[flake8-bandit] Allow urllib.request.urlopen calls with static Request argument \ 
(S310)
[flake8-bugbear] Treat raise NotImplemented-only bodies as stub functions (B006)
[flake8-slots] Respect same-file Enum subclasses (SLOT000)
[pylint] Support inverted comparisons (PLR1730)

Linter

Improve handling of builtin symbols in linter rules
Improve display of rules in --show-settings
Improve inference capabilities of the BuiltinTypeChecker
Resolve classes and functions relative to script name
Improve performance of RuleTable::any_enabled

Server

This section is devoted to updates for our new language server, written in Rust.

Enable ruff-specific source actions
Refreshes diagnostics for open files when file configuration is changed
Important errors are now shown as popups
Introduce settings for directly configuring the linter and formatter
Resolve configuration for each document individually
Write a setup guide for Neovim

Configuration

Add RUFF_OUTPUT_FILE environment variable support

Bug fixes

Avoid non-augmented-assignment for reversed, non-commutative operators (PLR6104)
Limit commutative non-augmented-assignments to primitive data types (PLR6104)
Respect per-file-ignores for RUF100 on blanket # noqa
Consider if expression for parenthesized with items parsing
Consider binary expr for parenthesized with items parsing
Reset FOR_TARGET context for all kinds of parentheses
   2024-04-13 07:18:10 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-ruff: updated to 0.3.7

0.3.7

Preview features

[flake8-bugbear] Implement loop-iterator-mutation (B909)
[pylint] Implement rule to prefer augmented assignment (PLR6104)

Bug fixes

Avoid TOCTOU errors in cache initialization
[pylint] Recode nan-comparison rule to W0177
[pylint] Reverse min-max logic in if-stmt-min-max

0.3.6

Preview features

[pylint] Implement bad-staticmethod-argument (PLW0211)
[pylint] Implement if-stmt-min-max (PLR1730, PLR1731)
[pyupgrade] Replace str,Enum multiple inheritance with StrEnum UP042
[refurb] Implement if-expr-instead-of-or-operator (FURB110)
[refurb] Implement int-on-sliced-str (FURB166)
[refurb] Implement write-whole-file (FURB103)
[refurb] Support itemgetter in reimplemented-operator (FURB118)
[flake8_comprehensions] Add sum/min/max to unnecessary comprehension check (C419)

Rule changes

[pydocstyle] Require capitalizing docstrings where the first sentence is a \ 
single word (D403)
[pycodestyle] Ignore annotated lambdas in class scopes (E731)
[flake8-pyi] Various improvements to PYI034
[flake8-slots] Flag subclasses of call-based typing.NamedTuples as well as \ 
subclasses of collections.namedtuple() (SLOT002)
[pyflakes] Allow forward references in class bases in stub files (F821)
[pygrep-hooks] Improve blanket-noqa error message (PGH004)

CLI

Support FORCE_COLOR env var

Configuration

Support negated patterns in [extend-]per-file-ignores

Bug fixes

[flake8-import-conventions] Accept non-aliased (but correct) import in \ 
unconventional-import-alias (ICN001)
[flake8-quotes] Add semantic model flag when inside f-string replacement field
[pep8-naming] Recursively resolve TypeDicts for N815 violations
[flake8-quotes] Respect Q00* ignores in flake8-quotes rules
[flake8-simplify] Show negated condition in needless-bool diagnostics (SIM103)
[ruff] Use within-scope shadowed bindings in asyncio-dangling-task (RUF006)
[flake8-pytest-style] Fix single-tuple conversion in \ 
pytest-parametrize-values-wrong-type (PT007)
[flake8-return] Ignore assignments to annotated variables in unnecessary-assign \ 
(RET504)
[refurb] Do not allow any keyword arguments for read-whole-file in rb mode (FURB101)
[pylint] Don't recommend decorating staticmethods with @singledispatch (PLE1519, \ 
PLE1520)
[pydocstyle] Use section name range for all section-related docstring diagnostics
Respect # noqa directives on __all__ openers
   2024-04-03 09:17:51 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-ruff: updated to 0.3.5

0.3.5

Preview features

[pylint] Implement modified-iterating-set (E4703)
[refurb] Implement for-loop-set-mutations (FURB142)
[refurb] Implement unnecessary-from-float (FURB164)
[refurb] Implement verbose-decimal-constructor (FURB157)

Rule changes

[flake8-comprehensions] Handled special case for C401 which also matches C416
[flake8-pyi] Mark unaliased-collections-abc-set-import fix as "safe" \ 
for more cases in stub files (PYI025)
[numpy] Add row_stack to NumPy 2.0 migration rule
[pycodestyle] Allow cell magics before an import (E402)
[pycodestyle] Avoid blank line rules for the first logical line in cell

Configuration

Respected nested namespace packages
[flake8-boolean-trap] Add setting for user defined allowed boolean trap

Bug fixes

Correctly handle references in __all__ definitions when renaming symbols in autofixes
Track ranges of names inside __all__ definitions
[flake8-bugbear] Avoid false positive for usage after continue (B031)
[flake8-copyright] Accept commas in default copyright pattern
[flake8-datetimez] Allow f-strings with %z for DTZ007
[flake8-pytest-style] Fix PT014 autofix for last item in list
[flake8-quotes] Ignore Q000, Q001 when string is inside forward ref
[isort] Always place non-relative imports after relative imports
[isort] Respect Unicode characters in import sorting
[pyflakes] Fix F821 false negatives when from __future__ import annotations is \ 
active (attempt 2)
[pyflakes] Make unnecessary-lambda an always-unsafe fix
[pylint] Fixed false-positive on the rule PLW1641 (eq-without-hash)
[ruff] Fix panic in unused # noqa removal with multi-byte space (RUF100)

Documentation

Add PR title format to CONTRIBUTING.md
Fix list markup to include blank lines required
Put flake8-logging next to the other flake8 plugins in registry
[flake8-bandit] Update warning message for rule S305 to address insecure block \ 
cipher mode use
[flake8-bugbear] Document use of anonymous assignment in useless-expression
[flake8-datetimez] Clarify error messages and docs for DTZ rules
[pycodestyle] Use same before vs. after numbers for space-around-operator
[ruff] Change quadratic-list-summation docs to use iadd consistently
   2024-03-21 21:06:03 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-ruff: updated to 0.3.4

0.3.4

Preview features

[flake8-simplify] Detect implicit else cases in needless-bool (SIM103)
[pylint] Implement nan-comparison (PLW0117)
[pylint] Implement nonlocal-and-global (E115)
[pylint] Implement singledispatchmethod-function (PLE5120)
[refurb] Implement list-reverse-copy (FURB187)

Rule changes

[flake8-pytest-style] Add automatic fix for pytest-parametrize-values-wrong-type \ 
(PT007)
[pycodestyle] Allow SPDX license headers to exceed the line length (E501)

Formatter

Fix unstable formatting for trailing subscript end-of-line comment

Bug fixes

Avoid code comment detection in PEP 723 script tags
Avoid incorrect tuple transformation in single-element case (C409)
Bug fix: Prevent fully defined links name from being reformatted
Consider raw source code for W605
Docs: Link inline settings when not part of options section
Don't treat annotations as redefinitions in .pyi files
Fix E231 bug: Inconsistent catch compared to pycodestyle, such as when dict \ 
nested in list
Fix pylint upstream categories not showing in docs
Add missing Options references to blank line docs
'Revert "F821: Fix false negatives in .py files when from __future__ import \ 
annotations is active
Apply NFKC normalization to unicode identifiers in the lexer
Avoid failures due to non-deterministic binding ordering
[flake8-bugbear] Allow tuples of exceptions (B030)
[flake8-quotes] Avoid syntax errors due to invalid quotes (Q000, Q002)
   2024-03-17 11:15:37 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-ruff: updated to 0.3.3

0.3.3

Preview features

[flake8-bandit]: Implement S610 rule
[pycodestyle] Implement blank-line-at-end-of-file (W391)
[pycodestyle] Implement redundant-backslash (E502)
[pylint] - implement redeclared-assigned-name (W0128)

Rule changes

[flake8_comprehensions] Handled special case for C400 which also matches C416
[flake8-bandit] Implement upstream updates for S311, S324 and S605
[pyflakes] Remove F401 fix for __init__ imports by default and allow opt-in to \ 
unsafe fix
[pylint] Implement invalid-bool-return-type (E304)
[pylint] Include builtin warnings in useless-exception-statement (PLW0133)

CLI

Add message on success to ruff check

Bug fixes

[PIE970] Allow trailing ellipsis in typing.TYPE_CHECKING
Avoid TRIO115 if the argument is a variable
[F811] Avoid removing shadowed imports that point to different symbols
Fix F821 and F822 false positives in .pyi files
Fix F821 false negatives in .py files when from __future__ import annotations is \ 
active
Fix case where Indexer fails to identify continuation preceded by newline
Sort hash maps in Settings display
Track conditional deletions in the semantic model
[C413] Wrap expressions in parentheses when negating
[pycodestyle] Do not ignore lines before the first logical line in blank lines rules.
[pycodestyle] Do not trigger E225 and E275 when the next token is a ')'
[pylint] Avoid false-positive slot non-assignment for __dict__ (PLE0237)
Gate f-string struct size test for Rustc < 1.76

Documentation

Use ruff.toml format in README
[RUF008] Make it clearer that a mutable default in a dataclass is only valid if \ 
it is typed as a ClassVar
[pylint] Extend docs and test in invalid-str-return-type (E307)
Remove . from check and format commands
   2024-03-11 14:29:54 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
py-ruff: update to 0.3.2.

Preview features

    Improve single-with item formatting for Python 3.8 or older (#10276)

Rule changes

    [pyupgrade] Allow fixes for f-string rule regardless of line length (UP032) \ 
(#10263)
    [pycodestyle] Include actual conditions in E712 diagnostics (#10254)

Bug fixes

    Fix trailing kwargs end of line comment after slash (#10297)
    Fix unstable with items formatting (#10274)
    Avoid repeating function calls in f-string conversions (#10265)
    Fix E203 false positive for slices in format strings (#10280)
    Fix incorrect Parameter range for *args and **kwargs (#10283)
    Treat typing.Annotated subscripts as type definitions (#10285)