-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: explicitly set shell in lint & format scripts #1391
Conversation
I saw that the It looks like EDIT: Also for the files that end in |
I have certainly missed things, still correcting and updating. This is a rabbit hole uncovering a lot of issues 😱 Haven't even started on resolving the issues. EDIT:
Both |
I'd say we keep their names and keep the declaration at the top. Since we want CI to pass for everyone, we can just add |
Right, I was wondering if we should just solve that now. Happy to ignore specifics for these files now. |
Oh wow yeah, there are 5 real violations in those files, yeah. In my opinion most of the file should be reworked anyways. The variables |
Yes, there are a lot of errors here.
|
I have commented out the updates to I will create issues to track the uncommenting of these scripts. |
Summary
In #1313 I ran some analysis of our Shellcheck errors with the Shell set explicitly to POSIX. Having done this I thought it might be worth updating our
scripts/*
to explicitly check specific files for specific Shell adherence (something discussed in #1313).What I discovered was that we were not testing some files or dirs, and also setting
bats
in Shellcheck introduced a whole set of errors which have clearly been missed with auto-detection.What I want with regards to review discussion is whether we actually captureasdf.sh
as a POSIX file or whether we should capture it in the.bash
linting? If we consider it Bash, should we rename itasdf.sh -> asdf.bash
? Same applies to/lib/asdf.sh
TODO:
scripts/*
shfmt
andshellcheck
for explicitly scanning.sh
,.bats
and.bash
files with the correct Shell settings.--indent
flag onshfmt
.shfmt
has integration to read from.editorconfig
, but it seems if you add--language-dialect
flag it no longer reads formatting settings from.editorconfig
, so we must match it manually with flags (as was done in the past).scripts/format.bash
to runshfmt
with correct settings across the codebase en masse.Related: #1313, #1349
Other Information