Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROPOSAL] live (graph) analysis #15198

Open
purajit opened this issue Dec 30, 2024 · 0 comments
Open

[PROPOSAL] live (graph) analysis #15198

purajit opened this issue Dec 30, 2024 · 0 comments
Labels
needs-decision Awaiting a decision from a maintainer wish Not on the current roadmap; maybe in the future

Comments

@purajit
Copy link
Contributor

purajit commented Dec 30, 2024

The basic idea is to start ruff in a mode where it monitors file changes and runs something whenever
it detects changes. Primarily, a user should be able to provide a command to be run, for instance, pytest.

This would allow users to run ruff analyze live --cmd -- pytest, which would then run pytest on
all impacted tests whenever a file is changed, while considering transitive dependencies; it could also
be used to understand how broad the scope of your changes might be (by just showing transitively
impacted files on each change), to monitor cyclic dependencies to see in real-time to check whether your
changes impact them, probably a ton more ideas others might have.

I have an MVP/WIP implementation in #15178.

Example uses:

  • ruff analyze live -- pytest to run all impacted tests
  • ruff analyze live --paths tests/test_a.py,tests/test_b.py -- pytest to only run specific tests if
    they are impacted
  • ruff analyze live: (unimplemented in the PR) could print certain code health/analysis on each change,
    like a list of impacted files, whether cyclic dependencies will be introduced, etc. For instance, if a repo
    is configured with data/config files in its include-dependencies, this could show how much might change if
    a seemingly simple JSON is edited. Depending on how useful this could be made, it could end up being
    something that's constantly running on the side and offering information and possibly aid.
@MichaReiser MichaReiser added wish Not on the current roadmap; maybe in the future needs-decision Awaiting a decision from a maintainer labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer wish Not on the current roadmap; maybe in the future
Projects
None yet
Development

No branches or pull requests

2 participants