这是indexloc提供的服务,不要输入任何密码
Skip to content

ruff --watch improvements: ignore dirs, debouncee #19573

@sathishvj

Description

@sathishvj

Summary

Summary
Improve the developer experience of ruff --watch by adding the ability to:

  1. Ignore specific directories or files

  2. Debounce file change events to reduce redundant action on rapid save operations or bulk changes

  3. Ignore Directories or Files
    Problem:
    Currently, it seems that ruff --watch triggers on all file changes. Again, it seems to be me that --exclude does not apply linting rules, but --watch still triggers.

  • Unnecessary linter runs
  • Jankiness/Flashing
  • Excessive CPU usage

Proposed Solution:
Introduce a CLI flag (and/or config option in pyproject.toml) to ignore specific directories or glob patterns. Example:

ruff --watch --ignore-dirs node_modules,.venv,build,dist```

pyproject.toml:

``toml
[tool.ruff.watch]
ignore = ["node_modules", ".venv", "build", "dist"]
  1. Debounce File Events
    similar to the above, to reduce overwork on fast file changes.

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the command-line interfacewishNot on the current roadmap; maybe in the future

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions