Skip to content

Normalization of all bash scripts #143

@Pshepp

Description

@Pshepp

We need to normalize all of our bash scripts. This includes:

  • Normalization and inclusion of correct shabangs in each script
  • Ensuring all file extensions are the same (so in files with a bash shabang, the file extension for these should be .bash). This can cause some messing with how the git history is tracked, so file extensions are not super high prority but we still need to hit this
  • Correct usage of return and exit within our bash commands.
  • Utilization of shellformat and shell check. The specific usage is below:
    • shellcheck --enable=require-variable-braces,quote-safe-variables,add-default-case <fileToLintHere>
    • shfmt -i 4 -ci -fn <fileToFormatHere>

Bug Description:
A recent bug caused by this was the gems/tests/run_tests.sh script having a #!/bin/sh shabang which caused it to not have the bash source command available to it. Furthermore, inconsistencies increases brain usage which is bad and makes scripts that would grab all specific files etc. to run tools on them more difficult.

Additional context
Think of different shells as kinda like different programming langauges. They are not all interchangeable, so we gotta keep that in mind. If we just stick to bash shells that use the baseline commands/progs we should be good. Getting a collection of all our scripts without shabangs would be good for someones first issue, actually changing them and ensuring the shabangs are correct is dependent on the devs skill level

Information regarding shabangs:

Information Regarding exit vs. return

Metadata

Metadata

Labels

GEMSGMMLScience in C++bugSomething isn't workingcall-for-commentsQuick space for comments about somethingenhancementImprove something that does exist

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions