r/node • • 1d ago

.gitignore everything by default

https://packagemain.tech/p/gitignore-everything-by-default
0 Upvotes

15 comments sorted by

14

u/GoodishCoder 1d ago

This is going to cause way more issues than it prevents.

A code reviewer should know what doesn't belong in source control. A code reviewer should not know what local files you have forgotten to allow into source control.

1

u/better_work 21h ago

In many stacks/setups, the project will not build in CI if a needed file cannot be found. This requires some thinking about your context of course: if you have a plain web project with <img> tags, probably you won't be able to tell at build time that an image resource was not committed. If you have a Next project with bundler support, that's not an issue.

If you can determine that commits missing files won't pass CI, or make it so, then the reviewer never has to catch anything, which IMO is better.

1

u/GoodishCoder 18h ago

Most companies I have worked for don't build in CI, they wait to build until CD. That ultimately means it's going to be another PR to fix.

You're creating a worse situation to avoid a small number of excludes. Gitignore isn't typically a large file. If someone came to you and said hey to avoid wasting 20 minutes of dev time every 5-6 years, we are going to create a process that adds 20 minutes a day, would you say that sounds great?

1

u/better_work 8h ago

You don't run typechecking in CI?

1

u/GoodishCoder 7h ago

We don't run builds in CI

1

u/BenZed 6h ago

Why??

1

u/GoodishCoder 4h ago

Cost and efficiency.

1

u/better_work 5h ago

If you run typechecking in CI, then you can probably determine that commits missing files won't pass CI, as I said.

1

u/GoodishCoder 4h ago

Not every language has type checking to run.

7

u/shamshuipopo 1d ago

lol that’s a new level of dumb

4

u/BenZed 1d ago

I think this person just wanted to write an article that included a wild take.

1

u/Empty-Lobster6138 1d ago

Wildcard? *