ejoffe / spr

Stacked Pull Requests on GitHub
MIT License
717 stars 65 forks source link

Error message on empty `.spr.yml` #334

Open ggoretkin-bdai opened 1 year ago

ggoretkin-bdai commented 1 year ago

It would be good to mention the filename .spr.yml in the following message:

$ git-spr --help
panic: EOF

goroutine 1 [running]:
github.com/ejoffe/rake.check(...)
    /Users/runner/go/pkg/mod/github.com/ejoffe/rake@v0.2.7/config.go:27
github.com/ejoffe/rake.(*yamlSource).Load(0xc0001f8f70, {0x7f9400, 0xc000147cc0})
    /Users/runner/go/pkg/mod/github.com/ejoffe/rake@v0.2.7/yaml_source.go:31 +0x2c5
github.com/ejoffe/rake.LoadSources({0x7f9400, 0xc000147cc0}, {0xc0001c3dd8, 0x4, 0x8c})
    /Users/runner/go/pkg/mod/github.com/ejoffe/rake@v0.2.7/config.go:21 +0xa9
github.com/ejoffe/spr/config/config_parser.ParseConfig({0x92d978, 0xc000130a50})
    /Users/runner/work/spr/spr/config/config_parser/config_parser.go:17 +0x30d
main.main()
    /Users/runner/work/spr/spr/cmd/spr/main.go:42 +0x156
piefel commented 6 months ago

It would be good not to panic. spr also panics on a YAML file containing only comments. Combined with #372 it makes the getting started process a bit hairy.