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 to pre-commit rules #115

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading