Skip to content

breml/gogitignore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Go Report Card
License

gogitignore

gogitignore searches a given directory for Go source files with package main and adds the resulting go build file (binary) to the .gitignore file. Find some additional information in this short blog post.

Install

go get github.com/breml/gogitignore

Usage

For basic usage, just enter the directory, which contains the Go source code and run gogitignore.

For help run gogitignore with flag -h or -help.

Task list

  • Find package main within provided directory
  • Find executables (executable bit set) within directory
  • Generate respective .gitignore entries
  • Find existing gogitignore block in .gitigore, replace if existing, create new otherwise
  • Print usage
  • Allow for inplace update of .gitignore
  • Make inplace mode default
  • Allow dryrun
  • Sort entries in .gitignore alphabetically
  • Cleanup variable names, find better ones
  • Write some tests, make it testable
  • Better duplicates check
  • Create .gitignore file if not yet present
  • Check with metalinter
  • Remove the autogenerated part (between # gogitignore start and # gogitignore end) from .gitignore
  • Use os.PathSeparator for better OS compatibility
  • Use fmt.Println istead of /dev/stdout for better OS compatibility
  • Add to travis
  • Add to coveralls
  • Add to go report
  • Add godoc

About

Automatically add go main packages executables to .gitignore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages