-
Notifications
You must be signed in to change notification settings - Fork 1
Normalization of all bash scripts #143
Copy link
Copy link
Closed
Labels
GEMSGMMLScience in C++Science in C++bugSomething isn't workingSomething isn't workingcall-for-commentsQuick space for comments about somethingQuick space for comments about somethingenhancementImprove something that does existImprove something that does exist
Metadata
Metadata
Assignees
Labels
GEMSGMMLScience in C++Science in C++bugSomething isn't workingSomething isn't workingcall-for-commentsQuick space for comments about somethingQuick space for comments about somethingenhancementImprove something that does existImprove something that does exist
Type
Fields
Give feedbackNo fields configured for issues without a type.
We need to normalize all of our bash scripts. This includes:
bashshabang, 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 thisreturnandexitwithin our bash commands.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.shscript having a#!/bin/shshabang which caused it to not have the bashsourcecommand 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
bashshells 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 levelInformation regarding shabangs:
Information Regarding
exitvs.returnreturnin our functions, and ngl we can useexitin our functions if the script is supposed to exit if a function fails but this pattern isnt very common. So let's just go forreturnon all our functions while usingexitto react to a failed functions return value