github.com/jmrodri/operator-sdk@v0.5.0/pkg/scaffold/gitignore.go (about) 1 // Copyright 2018 The Operator-SDK Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package scaffold 16 17 import ( 18 "github.com/operator-framework/operator-sdk/pkg/scaffold/input" 19 ) 20 21 const GitignoreFile = ".gitignore" 22 23 type Gitignore struct { 24 input.Input 25 } 26 27 func (s *Gitignore) GetInput() (input.Input, error) { 28 if s.Path == "" { 29 s.Path = GitignoreFile 30 } 31 s.TemplateBody = gitignoreTmpl 32 return s.Input, nil 33 } 34 35 const gitignoreTmpl = `# Temporary Build Files 36 build/_output 37 build/_test 38 # Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode 39 ### Emacs ### 40 # -*- mode: gitignore; -*- 41 *~ 42 \#*\# 43 /.emacs.desktop 44 /.emacs.desktop.lock 45 *.elc 46 auto-save-list 47 tramp 48 .\#* 49 # Org-mode 50 .org-id-locations 51 *_archive 52 # flymake-mode 53 *_flymake.* 54 # eshell files 55 /eshell/history 56 /eshell/lastdir 57 # elpa packages 58 /elpa/ 59 # reftex files 60 *.rel 61 # AUCTeX auto folder 62 /auto/ 63 # cask packages 64 .cask/ 65 dist/ 66 # Flycheck 67 flycheck_*.el 68 # server auth directory 69 /server/ 70 # projectiles files 71 .projectile 72 projectile-bookmarks.eld 73 # directory configuration 74 .dir-locals.el 75 # saveplace 76 places 77 # url cache 78 url/cache/ 79 # cedet 80 ede-projects.el 81 # smex 82 smex-items 83 # company-statistics 84 company-statistics-cache.el 85 # anaconda-mode 86 anaconda-mode/ 87 ### Go ### 88 # Binaries for programs and plugins 89 *.exe 90 *.exe~ 91 *.dll 92 *.so 93 *.dylib 94 # Test binary, build with 'go test -c' 95 *.test 96 # Output of the go coverage tool, specifically when used with LiteIDE 97 *.out 98 ### Vim ### 99 # swap 100 .sw[a-p] 101 .*.sw[a-p] 102 # session 103 Session.vim 104 # temporary 105 .netrwhist 106 # auto-generated tag files 107 tags 108 ### VisualStudioCode ### 109 .vscode/* 110 .history 111 # End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode 112 `