Skip to content

Fix globs in .gitignore and add more patterns.#7992

Open
mhucka wants to merge 5 commits intoquantumlib:mainfrom
mhucka:fix-gitignore
Open

Fix globs in .gitignore and add more patterns.#7992
mhucka wants to merge 5 commits intoquantumlib:mainfrom
mhucka:fix-gitignore

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented Mar 30, 2026

Changes:

  • Patterns like .mypy_cache/* did not match in subdirectories. Fixed.
  • Added .ruff_cache/ because we're beginning to use ruff.
  • Added patterns for miscellaneous editor backup & checkpoint files.

@github-actions github-actions bot added the size: S 10< lines changed <50 label Mar 30, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.63%. Comparing base (e74a2a3) to head (1babb35).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mhucka mhucka marked this pull request as ready for review March 30, 2026 21:44
@mhucka mhucka requested review from a team and vtomole as code owners March 30, 2026 21:44
@mhucka mhucka requested review from dstrain115 and pavoljuhas and removed request for dstrain115 March 30, 2026 21:44
Copy link
Copy Markdown
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us drop caches that already write their gitignore.

.cache/
.mypy_cache
.pytest_cache/
.ruff_cache/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For symmetry with others

NVM - let us remove mypy_cache completely.

Suggested change
.mypy_cache
.mypy_cache/

.mypy_cache/*
.pytest_cache/*
# ignore caches
.cache/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

@pavoljuhas pavoljuhas Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

@mhucka mhucka Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S 10< lines changed <50

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants