You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If when mypy writes a cache, it also did something like:
with open(os.path.join(cache_dir, '.gitignore', 'w')) as f:
f.write('*')
i.e. echo '*' > .mypy_cache/.gitignore
then nobody would ever be annoyed by the sudden appearance of thousands of untracked files.
Note this differs from issue #3336 which added the ignore files to particular projects. This would work for every project, and not interfere with anybody's existing top-level .gitignores.
I have not found the right place in the code to make the patch.
The text was updated successfully, but these errors were encountered:
IMO this shouldn't be the default. People will do weird stuff involving intentionally committing the cache to a repo for saving or reproducibility. It's definitely a bit odd, but this would make it work pretty far against the principle of least surprise.
Realistically, people will probably have other Python tooling-related stuff in their gitignore anyway.
This is an issue, if there is a tooling that parses .gitignore but doesn't traverse subdirectories. In those cases the .mypy_cache might still end up being processed, because of this change I forgot to add it to root folder's .gitignore.
It won't kill me, but this was totally unnecessary, and it is a gotcha if one is not aware of it.
This is an issue, if there is a tooling that parses .gitignore but doesn't traverse subdirectories.
That sounds like a bug in the tool you are using, not mypy. Furthermore, I do think most people probably are using mypy in a git vcs system where they don't want to check the cache into version control. Covering the 80% case seems like a good idea to me.
If when mypy writes a cache, it also did something like:
i.e.
echo '*' > .mypy_cache/.gitignore
then nobody would ever be annoyed by the sudden appearance of thousands of untracked files.
Note this differs from issue #3336 which added the ignore files to particular projects. This would work for every project, and not interfere with anybody's existing top-level .gitignores.
I have not found the right place in the code to make the patch.
The text was updated successfully, but these errors were encountered: