posener / goreadme

Generate readme file from Go doc. Now available as a Github action!
MIT License
213 stars 31 forks source link

Non-compliant naming of environment variables #98

Closed sjhitchner closed 3 years ago

sjhitchner commented 3 years ago

Environment variables, as per specification, should be UPPERCASE and use '_' as separator. Current code using lowercase and '-'.

https://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html

I don't think most *UNIX shells will even let you set environment variables that are lowercase and use a '-'

https://github.com/posener/goreadme/blob/master/cmd/goreadme/main.go#L30 https://github.com/posener/goreadme/blob/master/cmd/goreadme/main.go#L35 https://github.com/posener/goreadme/blob/master/cmd/goreadme/main.go#L37

Also might be help to add some information to the help that details what environment need to be set specifically the GITHUB_TOKEN.

Useful took. I'm excited to start using the tool once I can specify a git token for a private repo :)

posener commented 3 years ago

Thanks! You are right! And I'm sorry about it.

However, you can set these env, e.g run: env 'readme-file=docs/readme.md' goreadme.

If you find a way to fix this issue with a non-breaking change, I'll be happy to merge it!