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

Add Shellcheck support via GitHub Actions. Fixes all violations. #101

Closed
wants to merge 5 commits into from

Conversation

anavarre
Copy link
Contributor

@anavarre anavarre commented Jun 12, 2024

  • Fixed all Shellcheck violations
  • Sometimes resorted to using # shellcheck disable=<shellcheck_code> immediately above a line to silence violations (per https://www.shellcheck.net/wiki/Directive) since I can't test this code locally (I'm on Mac but supportive of the effort!) and don't want to break things (this should still be tested as I might have missed something).

Background: #70 was reverted because the lift was too much and master needed to be cleaned up first.


Artifact for disabled violations:

❯ ack "shellcheck disable"
install/set-framework-text-scaling.sh
4:# shellcheck disable=SC2063

install/app-signal.sh
4:# shellcheck disable=SC2002

install/set-theme.sh
4:# shellcheck disable=SC1091

install/a-shell.sh
5:# shellcheck disable=SC1091

install/apps-web.sh
3:# shellcheck disable=SC1090

install/docker.sh
7:# shellcheck disable=SC1091

install/select-optional-apps.sh
4:# shellcheck disable=SC2140
8:	# shellcheck disable=SC1090

install/select-dev-env.sh
4:# shellcheck disable=SC2140
28:# shellcheck disable=SC2140

install.sh
15:# shellcheck disable=SC1090

install/app-chrome.sh Outdated Show resolved Hide resolved
@anavarre
Copy link
Contributor Author

anavarre commented Jun 12, 2024

And here's evidence that Shellcheck fires up fine https://github.com/basecamp/omakub/actions/runs/9482343428/job/26127026453?pr=101

@iljo-dp
Copy link

iljo-dp commented Jun 12, 2024

I know shellcheck likes this, but imo it isn't really needed, and imo kind of ruins the cleanness of the codebase, because the code will still work

#!/usr/bin/env bash

@anavarre
Copy link
Contributor Author

I know shellcheck likes this, but imo it isn't really needed,

Explanation here: https://stackoverflow.com/a/25202821

I'd say if we want to start turning off rules that Shellcheck ships with, it's perphaps a sign that we don't want Shellcheck to begin with.

@rmacklin
Copy link
Contributor

Disagree that it ruins cleanliness - it's just one comment line in the scripts, and it ensures the scripts will work correctly (by invoking bash) even if the user has switched to a different shell after installation.

@anavarre
Copy link
Contributor Author

@dhh I keep on rebasing changes (you move fast!), so in order to proceed with integrating the codebase with Shellcheck, if you're still interested with this I think we should merge ASAP.

@dhh
Copy link
Member

dhh commented Jun 14, 2024

Hmm, looking through the list of changes, I'm not sure I'm seeing enough value here. I like the idea in theory, but the practice of the diff isn't convincing enough imo. Appreciate you investigating this though!

@dhh dhh closed this Jun 14, 2024
@rmacklin
Copy link
Contributor

@dhh Separate from the other changes, would you accept the addition of a #!/usr/bin/env bash shebang to the scripts to ensure they will be invoked with bash even if the user has changed their shell after installation? IMO that part is valuable

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.

5 participants