Fix globs in .gitignore and add more patterns.#7992
Fix globs in .gitignore and add more patterns.#7992mhucka wants to merge 5 commits intoquantumlib:mainfrom
.gitignore and add more patterns.#7992Conversation
Patterns like `.mypy_cache/*` did not match in subdirectories.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7992 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 1110 1110
Lines 99698 99698
=======================================
Hits 99336 99336
Misses 362 362 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pavoljuhas
left a comment
There was a problem hiding this comment.
Let us drop caches that already write their gitignore.
| .cache/ | ||
| .mypy_cache | ||
| .pytest_cache/ | ||
| .ruff_cache/ |
There was a problem hiding this comment.
Please remove .ruff_cache. They already do it for us by writing their own .gitignore with a * pattern.
Addendum - so do mypy and pytest so let's remove the .mypy_cache/ and .pytest_cache/ patterns too.
| .pytest_cache/* | ||
| # ignore caches | ||
| .cache/ | ||
| .mypy_cache |
There was a problem hiding this comment.
For symmetry with others
NVM - let us remove mypy_cache completely.
| .mypy_cache | |
| .mypy_cache/ |
| .mypy_cache/* | ||
| .pytest_cache/* | ||
| # ignore caches | ||
| .cache/ |
There was a problem hiding this comment.
Do you know of a tool that creates .cache?
It does not exist on my workstation in any of source repositories.
Maybe we can drop this.
|
|
||
| # notebook test output | ||
| /out | ||
|
|
There was a problem hiding this comment.
I feel these should go to a global gitignore as they reflect developers' choice of editor and whether they write backups or not. I don't see these patterns in https://github.com/github/gitignore/blob/main/Python.gitignore.
My take for Cirq gitignore would be to handle temporary files that are from Python (pyc-s), unit tests, QA tools that we use, packaging and docs build; maybe a few popular IDEs. Most other things should be out of scope.
There was a problem hiding this comment.
I think that's a reasonable take, and one that I would favor. However, one reason to put the patterns in .gitignore is that Gemini CLI will find them there. In another project, I had put them in .geminiignore (precisely because I already had them in my personal global .gitignore, but Gemini CLI doesn't read that), and someone then objected, saying they should go in .gitignore. ¯_(ツ)_/¯
Would moving the extra patterns to .geminiignore be okay with you?
There was a problem hiding this comment.
Would moving the extra patterns to .geminiignore be okay with you?
gitignore would be preferable to that. How about configuring your editor to write backups out of the project? I use a ~/.backup/ directory for that.
It is not a big deal so if you need those patterns it is fine. Still we should delete the some_cache entries which set up gitignores of their own.
Changes:
.mypy_cache/*did not match in subdirectories. Fixed..ruff_cache/because we're beginning to useruff.