Skip to content

Commit 20eeeff

Browse files
create local shellcheck hook that uses shellcheck from container (#523)
fixes #520 Co-authored-by: Derek Hower <[email protected]>
1 parent 3b854dc commit 20eeeff

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

.devcontainer/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ RUN apt-get install -y --no-install-recommends git \
2525
clang-format \
2626
clang-tidy \
2727
libelf-dev \
28-
gcc-riscv64-unknown-elf
28+
gcc-riscv64-unknown-elf \
29+
shellcheck
2930
RUN apt-get clean autoclean
3031
RUN apt-get autoremove -y
3132
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/*

.pre-commit-config.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,14 @@ repos:
7474
hooks:
7575
- id: pyupgrade
7676

77-
# - repo: https://github.com/koalaman/shellcheck-precommit
78-
# rev: v0.10.0
79-
# hooks:
80-
# - id: shellcheck
81-
# args: ["--severity=error"]
77+
- repo: local
78+
hooks:
79+
- id: shellcheck
80+
name: shellcheck
81+
types: [shell]
82+
language: system
83+
entry: shellcheck
84+
args: ["--severity=error"]
8285

8386
- repo: https://github.com/scop/pre-commit-shfmt
8487
rev: v3.11.0-1

bin/.container-tag

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5
1+
0.6

container.def

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ From: ubuntu:24.04
3434
libelf-dev \
3535
gcc-riscv64-linux-gnu \
3636
gcc-riscv64-unknown-elf \
37-
libc6-dev-riscv64-cross
37+
libc6-dev-riscv64-cross \
38+
shellcheck
3839
# cleanup
3940
apt-get clean autoclean
4041
apt-get autoremove -y

lib/deploy.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# deploy artifacts to a directory, in preparation for GitHub deployment
44

5-
ROOT=$(dirname $(dirname $(realpath $BASH_SOURCE[0])))
5+
ROOT=$(dirname $(dirname $(realpath ${BASH_SOURCE[0]})))
66

77
DEPLOY_DIR="$ROOT/_site"
88
PAGES_URL="https://riscv-software-src.github.io/riscv-unified-db"

0 commit comments

Comments
 (0)