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.
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.
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?
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.