phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
http://scenerystack.org/
MIT License
4 stars 5 forks source link

convention for variable names in shell scripts #74

Open pixelzoom opened 6 years ago

pixelzoom commented 6 years ago

Noted while reviewing https://github.com/phetsims/perennial/issues/68#issuecomment-358735634 ...

By convention, environment variables (e.g. HOME) and internal shell variables (e.g. SHELL) are capitalized. Variable names are case-sensitive, so this convention avoids accidentally overriding environment and internal variables. If you use this convention, you can rest assured that you don't need to know every environment variable used by UNIX tools or shells in order to avoid overwriting them. If it's your variable, lowercase it. If you export it, uppercase it. More at stackoverflow.

Scripts in perennial do not currently follow this convention (including those written by me). Not a high priority to change them all at once, perhaps address this when a script requires other changes and retesting. Good to be aware of going forward, so labeling for "FYI" at developer meeting.

jonathanolson commented 6 years ago

Also notably relevant to yotta and other repositories.

The proposal for lower-cased local variables sounds good to me.