lint: Run codespell automatically

Signed-off-by: Colin Watson <cjwatson@debian.org>
This commit is contained in:
Colin Watson 2025-03-16 17:44:45 +00:00 committed by Stéphane Graber
parent 4e37b921df
commit 99f8b39716
No known key found for this signature in database
GPG Key ID: C638974D64792D67
6 changed files with 21 additions and 1 deletions

6
.codespell-ignore Normal file
View File

@ -0,0 +1,6 @@
AtLeast
destOp
ECT
inport
renderD
requestor

View File

@ -50,6 +50,7 @@ RUN sed -r -i 's/^Components: main$/Components: main contrib/g' /etc/apt/sources
lxc-templates \ lxc-templates \
make \ make \
man-db \ man-db \
pipx \
pkg-config \ pkg-config \
protoc-gen-go \ protoc-gen-go \
python3-matplotlib \ python3-matplotlib \
@ -69,6 +70,9 @@ RUN sed -r -i 's/^Components: main$/Components: main contrib/g' /etc/apt/sources
# zfsutils-linux # zfsutils-linux
xz-utils xz-utils
# With pipx >= 1.5.0, we could use pipx --global instead.
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install codespell
# Add vscode user and add it to sudoers. # Add vscode user and add it to sudoers.
RUN groupadd -g 1000 $USERNAME && \ RUN groupadd -g 1000 $USERNAME && \
useradd -s /bin/bash -u $USER_UID -g $USER_GID -m $USERNAME && \ useradd -s /bin/bash -u $USER_UID -g $USER_GID -m $USERNAME && \

View File

@ -90,10 +90,13 @@ jobs:
libtool \ libtool \
libudev-dev \ libudev-dev \
make \ make \
pipx \
pkg-config \ pkg-config \
shellcheck shellcheck
python3 -m pip install flake8 # With pipx >= 1.5.0, we could use pipx --global instead.
PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin \
pipx install codespell flake8
- name: Fix repository permissions - name: Fix repository permissions
run: | run: |

View File

@ -307,6 +307,10 @@ endif
ifeq ($(shell command -v flake8),) ifeq ($(shell command -v flake8),)
echo "Please install flake8" echo "Please install flake8"
exit 1 exit 1
endif
ifeq ($(shell command -v codespell),)
echo "Please install codespell"
exit 1
endif endif
flake8 test/deps/import-busybox flake8 test/deps/import-busybox
shellcheck --shell sh test/*.sh test/includes/*.sh test/suites/*.sh test/backends/*.sh test/lint/*.sh shellcheck --shell sh test/*.sh test/includes/*.sh test/suites/*.sh test/backends/*.sh test/lint/*.sh

View File

@ -35,6 +35,7 @@ pkgs.mkShell {
gopls gopls
# static-analysis # static-analysis
codespell
debianutils debianutils
go-licenses go-licenses
go-swagger go-swagger

2
test/lint/codespell.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh -eu
codespell -S 'internal/server/apparmor/*.profile.go' -I .codespell-ignore client cmd doc grafana internal scripts shared test