Skip to content
Snippets Groups Projects
Unverified Commit 346a4662 authored by Oliver Smith's avatar Oliver Smith
Browse files

CI: run codespell instead of checkpatch spellcheck

In theory checkpatch.pl should use its spelling.txt to check for spell
errors in the code, but it seems to be broken for some reason. It also
has code to use codespell's dictionaries... but just use codespell
directly.
parent e011bb0c
Branches wip
No related tags found
No related merge requests found
Pipeline #141459 passed
#!/bin/sh -ex
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2023 Oliver Smith
# Description: find typos
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
py3-codespell
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
codespell \
--skip="./subprojects,./po" \
. \
.ci/*
......@@ -9,17 +9,15 @@
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
# Download checkpatch from linux.git
cd "$SCRIPT_DIR"
for f in checkpatch.pl spelling.txt; do
if ! [ -e "$SCRIPT_DIR/$f" ]; then
url="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/$f"
echo "Download: $url"
wget -q "$url"
chmod +x "$f"
fi
done
cd ..
if ! [ -e "$SCRIPT_DIR/checkpatch.pl" ]; then
cd "$SCRIPT_DIR"
url="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl"
echo "Download: $url"
wget -q "$url"
chmod +x "checkpatch.pl"
touch spelling.txt
cd ..
fi
# NOTE: giving all files directly as arguments to checkpatch.pl was buggy, so
# call it once per file for now. See .checkpatch.conf for additional options.
......
---
image: "alpine:latest"
image: "alpine:edge"
lint:
before_script:
......@@ -7,6 +7,13 @@ lint:
script:
- .ci/lint.sh
codespell:
before_script:
- "echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories"
- "adduser -D build"
script:
- .ci/codespell.sh
build-pmOS:
before_script:
- "apk -q add git"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment