Update Python.gitignore for .ruff_cache/
Add Ruff cache in gitignore. Ruff is becoming a very popular tool often run in pre-commit and aim 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.
Reasons for making this change: Ruff is run in pre-commit thus .ruff_cache/ could be included accidently in git. Actually this is similar to .mypy_cache/ which is also run in pre-commit.
Links to documentation supporting these rule changes: https://github.com/charliermarsh/ruff in section configuration we can see the exclude of .ruff_cache and .mypy_cache
See also #4199
I think this is not required, as ruff will add a .gitignore file to the .ruff_cache folder with * as content effectively ignoring the folder.
See https://github.com/astral-sh/ruff/issues/204 and https://github.com/astral-sh/ruff/pull/208
It is nicer to have it there.
e.g. PyCharm's excluded folders (and https://plugins.jetbrains.com/plugin/17288-foldable-projectview) work based on these ignore
@JasperJuergensen pytest does the same - it also adds .gitignore with * to its cache dir. But .pytest_cache it's included in the template... The same regards nox, for instance.
I agree that it is nice to have .ruff_cache directory similarly to .mypy_cache and .pytest_cache directories. The ruff project is steadily developing and becoming widespread, so it is good to have already the section for it.
Also was mentioned in https://github.com/github/gitignore/pull/4199 and https://github.com/github/gitignore/pull/4274 PRs.
For instance, without the .ruff_cache line in .gitignore file this directory is not grayed:
When added: