-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg:generator: Generate .gitignore at top and for tmp/_output #232
Conversation
Hey, this would fix #185 🎉 It would be nice to add the following entries as well:
There is a Thanks |
pkg/generator/gitignore_tmpls.go
Outdated
|
||
package generator | ||
|
||
const tmpGitignoreTmpl = `_output` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we let the .gitignore
at the project root to ignore the tmp/_output
folder instead?
e.g:
# Folders
tmp/_output/
.netrwhist | ||
# auto-generated tag files | ||
tags | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want to ignore the following as well:
### Build Folders
vendor/
tmp/_output/
pkg/generator/generator.go
Outdated
@@ -266,6 +296,16 @@ func (g *Generator) renderTmp() error { | |||
return renderCodegenFiles(cDir, g.repoPath, apiDirName(g.apiVersion), version(g.apiVersion), g.projectName) | |||
} | |||
|
|||
func renderTmpGitignore(tDir string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary. Just let the project root .gitignore
handle all the ignoring files.
I addressed the comments, though I did not include vendor. Why wouldn't we suggest people include vendor? I know that the dep lock should allow it to be recreated, but if you want people to be able to build what you wrote... |
Oh, I didn't include "tmp" either. It (like vendor) could easily be a followup... |
Any reason to have to two .gitignore files? |
The top level ignore goland, vim, and emacs files The tmp/.gitignore ignores tmp/_output
I removed the 2nd .gitignore but forgot to remove the 2nd "template". It's gone now. I think this can merge and we can enhance it in other PRs. |
lgtm Thanks! |
The top level ignore golang, vim, and emacs files
The tmp/.gitignore ignores tmp/_output