Skip to content

Commit

Permalink
Merge pull request #115 from booxter/shellcheck
Browse files Browse the repository at this point in the history
Add shellcheck to pre-commit rules
  • Loading branch information
booxter committed Jul 6, 2024
2 parents fd95f96 + f8d8d6b commit a73e4d9
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .flox/env/manifest.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
"requests": {
"pkg-path": "python311Packages.requests"
},
"shellcheck": {
"pkg-path": "shellcheck"
},
"sqlalchemy": {
"pkg-path": "python311Packages.sqlalchemy"
},
Expand Down Expand Up @@ -610,6 +613,34 @@
},
"priority": 5
},
"shellcheck": {
"attr-path": [
"legacyPackages",
"aarch64-darwin",
"shellcheck"
],
"info": {
"broken": false,
"description": "Shell script analysis tool",
"license": "GPL-3.0-only",
"pname": "ShellCheck",
"unfree": false,
"version": "0.9.0"
},
"input": {
"attrs": {
"lastModified": 1716576784,
"narHash": "sha256-zLNbgqclRnQdhp/uw7v0SnSRC9KPECJRMxuxXeWOdkw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "060b6d4e71327fc1870f7759fc6980cadc17601c",
"type": "github"
},
"fingerprint": "008ff148973bd338c38cd51c2096fada84e3f9df0517c51562fdadf315a845f5",
"url": "github:NixOS/nixpkgs/060b6d4e71327fc1870f7759fc6980cadc17601c"
},
"priority": 5
},
"sqlalchemy": {
"attr-path": [
"legacyPackages",
Expand Down Expand Up @@ -1184,6 +1215,34 @@
},
"priority": 5
},
"shellcheck": {
"attr-path": [
"legacyPackages",
"x86_64-darwin",
"shellcheck"
],
"info": {
"broken": false,
"description": "Shell script analysis tool",
"license": "GPL-3.0-only",
"pname": "ShellCheck",
"unfree": false,
"version": "0.9.0"
},
"input": {
"attrs": {
"lastModified": 1716576784,
"narHash": "sha256-zLNbgqclRnQdhp/uw7v0SnSRC9KPECJRMxuxXeWOdkw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "060b6d4e71327fc1870f7759fc6980cadc17601c",
"type": "github"
},
"fingerprint": "008ff148973bd338c38cd51c2096fada84e3f9df0517c51562fdadf315a845f5",
"url": "github:NixOS/nixpkgs/060b6d4e71327fc1870f7759fc6980cadc17601c"
},
"priority": 5
},
"sqlalchemy": {
"attr-path": [
"legacyPackages",
Expand Down
1 change: 1 addition & 0 deletions .flox/env/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ openapi-generator-cli.pkg-path = "openapi-generator-cli"
pycountry.pkg-path = "python311Packages.pycountry"
act.pkg-path = "act"
pip.pkg-path = "python311Packages.pip"
shellcheck.pkg-path = "shellcheck"
# hello.pkg-path = "hello"
# nodejs = { version = "^18.4.2", pkg-path = "nodejs_18" }

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install distro dependencies
run: |
sudo apt-get update
sudo apt-get install shellcheck
- uses: pre-commit/action@v3.0.1
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ repos:
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: local
hooks:
- id: shellcheck
name: shellcheck
description: Test shell scripts with shellcheck
entry: shellcheck
language: python
types: [shell]
require_serial: true # shellcheck can detect sourcing this way
exclude: |
(?x)^(
letsrolld-api-client/.*|
Expand Down
2 changes: 1 addition & 1 deletion sanity-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sleep 5

# check that it is running and returns some data
lines=$(lcli films get | wc -l)
test $lines -eq 10 # 10 is default in webapi
test "$lines" -eq 10 # 10 is default in webapi

# we know which directors we fed into the database
# (the first two entries in the input file)
Expand Down

0 comments on commit a73e4d9

Please sign in to comment.