convex-js
convex-js copied to clipboard
Fix `.env.local` additions in `.gitignore`
I'm working on an open source repo that requires contributors to initialize Convex on their local machines. I've noticed a few contributors push code that adds .env.local at the bottom of .gitignore, even though it's already listed above. I think this is being added automatically during the initialization process. Is there a way to disable this, or to improve the .gitignore pattern matching so it doesn't get added?
This PR updates the changesToGitIgnore() function to more robustly check for .env.local (and related variants), accounting for /r on Windows or extra whitespace which previously led to false positives.
New test cases were added to verify the updated conditions.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
After reviewing the .gitignore spec: inline comments with # aren't valid. Comments must always start on a new line. Updated the matching + tests to reflect this.
Thanks for the fix @evadecker! This PR merged in https://github.com/get-convex/convex-js/commit/1af1b7f50e1a0ecfcfe850f51bc804ea41a67f73
@thomasballinger it looks like the last commit in my PR was left out of the merged version.
I had to change some logic because inline comments aren't valid in .gitignore, and I was concerned splitting on # could potentially split a directory or file by mistake (very unlikely but possible)
https://github.com/get-convex/convex-js/commit/c853fccb12421a2a104a71cff559b739713f77c6
Also added other test cases
Oops, thanks. I'll fix that up and fix the script that pulls things into the other repo.
@thomasballinger Doing some PR cleanup for myself. It looks like all these changes made it in, can this be closed?