mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-02-07 00:55:44 +01:00
shellcheck: move common directives to .shellcheckrc
This simplifies our CI command line and makes it easier to document expected usage (in HACKING.md). There unfortunately isn't a way to set --checked-sourced or our default warning level in .shellcheckrc, and our `find` command is still a bit unwieldy, but this is still a net improvement.
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -978,8 +978,6 @@ jobs:
|
||||
--check-sourced \
|
||||
--color=always \
|
||||
--severity=warning \
|
||||
--shell=bash \
|
||||
--external-sources \
|
||||
$(find . \( -name "*.sh" -o -name "*.bash" \) -type f ! -path "./zig-out/*" ! -path "./macos/build/*" ! -path "./.git/*" | sort)
|
||||
|
||||
translations:
|
||||
|
||||
8
.shellcheckrc
Normal file
8
.shellcheckrc
Normal file
@@ -0,0 +1,8 @@
|
||||
# ShellCheck <https://www.shellcheck.net/>
|
||||
# https://github.com/koalaman/shellcheck/wiki/Directive#shellcheckrc-file
|
||||
|
||||
# Allow opening any 'source'd file, even if not specified as input
|
||||
external-sources=true
|
||||
|
||||
# Assume bash by default
|
||||
shell=bash
|
||||
22
HACKING.md
22
HACKING.md
@@ -164,6 +164,28 @@ alejandra .
|
||||
|
||||
Make sure your Alejandra version matches the version of Alejandra in [devShell.nix](https://github.com/ghostty-org/ghostty/blob/main/nix/devShell.nix).
|
||||
|
||||
### ShellCheck
|
||||
|
||||
Bash scripts are checked with [ShellCheck](https://www.shellcheck.net/) in CI.
|
||||
|
||||
Nix users can use the following command to run ShellCheck over all of our scripts:
|
||||
|
||||
```
|
||||
nix develop -c shellcheck \
|
||||
--check-sourced \
|
||||
--severity=warning \
|
||||
$(find . \( -name "*.sh" -o -name "*.bash" \) -type f ! -path "./zig-out/*" ! -path "./macos/build/*" ! -path "./.git/*" | sort)
|
||||
```
|
||||
|
||||
Non-Nix users can [install ShellCheck](https://github.com/koalaman/shellcheck#user-content-installing) and then run:
|
||||
|
||||
```
|
||||
shellcheck \
|
||||
--check-sourced \
|
||||
--severity=warning \
|
||||
$(find . \( -name "*.sh" -o -name "*.bash" \) -type f ! -path "./zig-out/*" ! -path "./macos/build/*" ! -path "./.git/*" | sort)
|
||||
```
|
||||
|
||||
### Updating the Zig Cache Fixed-Output Derivation Hash
|
||||
|
||||
The Nix package depends on a [fixed-output
|
||||
|
||||
Reference in New Issue
Block a user