Skip to content
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

ShellCheck for various helper bash scripts #531

Merged

Conversation

seberm
Copy link
Contributor

@seberm seberm commented Aug 4, 2022

This PR adds shellcheck lint to helper bash scripts, for more info please see:

@seberm seberm changed the title Feature/shellcheck for helper scripts Shellcheck for various helper bash scripts Aug 4, 2022
@seberm seberm changed the title Shellcheck for various helper bash scripts ShellCheck for various helper bash scripts Aug 4, 2022
@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch 5 times, most recently from 14d788a to b4b10bb Compare August 8, 2022 13:46
@seberm seberm marked this pull request as ready for review August 8, 2022 14:06
Copy link
Member

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @seberm, this is very helpful! I skimmed the shellcheck'd code and ran a few of the scripts. Looks good.

.cirrus.yml Outdated Show resolved Hide resolved
test/ci/shellcheck.sh Outdated Show resolved Hide resolved
test/ci/shellcheck.sh Outdated Show resolved Hide resolved
@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch 2 times, most recently from 25491c6 to a924260 Compare August 16, 2022 14:03
@seberm
Copy link
Contributor Author

seberm commented Aug 16, 2022

Hello @jonasnick ,
thank you for your review! I've made the suggested changes and added the shellcheck into the run-tests.sh. Let me know if everything works as expected.

@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch 2 times, most recently from c5c3881 to d99e91d Compare August 25, 2022 09:55
@seberm
Copy link
Contributor Author

seberm commented Aug 25, 2022

Hello @jonasnick ,
I have rebased the changes against the current master.

@seberm seberm requested a review from jonasnick August 25, 2022 10:09
Copy link
Member

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @seberm. ACK mod nits. I want to merge this PR asap to avoid having to rebase it all the time. @erikarvstedt can you Concept ACK this?

test/ci/shellcheck.sh Outdated Show resolved Hide resolved
test/run-tests.sh Outdated Show resolved Hide resolved
@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch from d99e91d to c4e7828 Compare August 26, 2022 06:27
jonasnick
jonasnick previously approved these changes Aug 26, 2022
Copy link
Member

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK c4e78281985aa53fec067ed778979aace956206e

Copy link
Collaborator

@erikarvstedt erikarvstedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks a lot!

Fixed branch.

  • Fix start-bash-session.sh which was broken due to shellcheck comments inserted into a
    multi-line command.
  • run-tests.sh: Fix rounding down of memAvailableKiB
  • run-tests.sh: Add shellcheck binary to PATH for test shellcheck
  • shellcheck.sh: Simplify, always check all scripts in repo
  • .cirrus.yml: Improve usage of the root flake
  • .cirrus.yml: Use the actual Nix version from NixOS 22.05
  • .cirrus.yml: Simplify test shellcheck

@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch 2 times, most recently from 5d0d700 to ff247c1 Compare August 28, 2022 14:36
@erikarvstedt
Copy link
Collaborator

erikarvstedt commented Aug 28, 2022

Fixed branch.

Thanks for fixing fetch-release.
Instead of renaming the file, I've now modified the test script to include files without extensions that have a
shell shebang.
This avoids renaming a user-facing command and is more future proof.

@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch from e3613ea to 1a0df13 Compare August 28, 2022 15:19
@seberm
Copy link
Contributor Author

seberm commented Aug 28, 2022

Hello Erik,
you were quick :) !, thanks a lot for your review and the changes!

Hopefully I have rebased everything correctly :). Let me know if anything more is needed.

@seberm seberm requested a review from erikarvstedt August 28, 2022 15:38
Copy link
Collaborator

@erikarvstedt erikarvstedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 1a0df13d6c56d2120ecdb2027fc45c435f889cd4

@seberm seberm requested a review from jonasnick August 28, 2022 15:46
Copy link
Collaborator

@erikarvstedt erikarvstedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, last fix: I've updated my branch above to pin shellcheck (and other binaries) used in the CI script to our version of nixpkgs.

@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch from 1a0df13 to 8a7a917 Compare August 28, 2022 16:15
@seberm
Copy link
Contributor Author

seberm commented Aug 28, 2022

Sorry, last fix: I've updated my branch above to pin shellcheck (and other binaries) used in the CI script to our version of nixpkgs.

No problem.

@seberm seberm force-pushed the feature/shellcheck-for-helper-scripts branch from 8a7a917 to 91a03ce Compare August 28, 2022 16:27
Copy link
Collaborator

@erikarvstedt erikarvstedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 91a03ce

Copy link
Member

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonasnick jonasnick merged commit 1ca8b3d into fort-nix:master Aug 28, 2022
@seberm seberm mentioned this pull request Sep 6, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants