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

[feature-request] Allow --watch to automatically fix when combined with --fix #1064

Closed
phillipuniverse opened this issue Dec 5, 2022 · 1 comment · Fixed by #4035
Closed
Labels
cli Related to the command-line interface good first issue Good for newcomers

Comments

@phillipuniverse
Copy link
Contributor

phillipuniverse commented Dec 5, 2022

Running the following:

ruff . --fix --watch

I would expect that Ruff would automatically fix files that it watches, not just display the errors. But it appears that the --watch clobbers --fix in that it will watch files and just report the errors.

If I stop watching and then ruff . --fix, ruff automatically fixes issues that it found.

@phillipuniverse phillipuniverse changed the title [feature-request] Allow --watch to automatically fix with --fix [feature-request] Allow --watch to automatically fix when combined with --fix Dec 5, 2022
@charliermarsh
Copy link
Member

I initially held off on this because --watch is based on file-watching, and autofixing will modify those files thus triggering another invocation. It may actually work as-is, though. I can at least test it out.

@charliermarsh charliermarsh added cli Related to the command-line interface good first issue Good for newcomers and removed enhancement labels Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command-line interface good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants