mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 14:38:51 +02:00
lint updated recipes as well, and move script (#7926)
* also lint changed recipes
example commit taken from a recent PR:
$ git diff HEAD HEAD~ --numstat
7 7 media-sound/freac/{freac-1.1.7.recipe => freac-1.1.6.recipe}
-> lint-new-recipes.sh tries to find `media-sound/freac/{freac-1.1.7.recipe` which does not exist
$ git diff --no-renames HEAD HEAD~ --numstat
98 0 media-sound/freac/freac-1.1.6.recipe
0 98 media-sound/freac/freac-1.1.7.recipe
-> lint-new-recipes.sh skips over 1.1.6 (because it is gone) and lints 1.1.7
* move lint-new-recipes.sh into .github/
This commit is contained in:
19
.github/lint-new-recipes.sh
vendored
Executable file
19
.github/lint-new-recipes.sh
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Lints all the recipes created / modified since upstream HEAD.
|
||||
git remote add real_origin https://github.com/haikuports/haikuports.git || true
|
||||
git fetch real_origin
|
||||
|
||||
files=$(git diff --no-renames $(git rev-parse --abbrev-ref HEAD) real_origin/master --numstat | awk '{print $3}')
|
||||
for file in $files; do
|
||||
if [ -e "$file" ] && [[ "$file" == *recipe ]]; then
|
||||
LINES=$(grep -l '[[:blank:]]$' $file)
|
||||
if [ ! -z "$LINES" ]; then
|
||||
echo "Trailing whitespace in '$file'."; exit 1
|
||||
fi
|
||||
|
||||
baseName=$(basename $file)
|
||||
portName=${baseName::-7}
|
||||
haikuporter $@ --lint $portName
|
||||
if [ $? -ne 0 ]; then exit 1; fi
|
||||
fi
|
||||
done
|
||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -29,4 +29,4 @@ jobs:
|
||||
- name: 'Lint new recipes'
|
||||
run: |
|
||||
export "PATH=$PATH:../haikuporter"
|
||||
./lint-new-recipes.sh --config=haikuports.conf --licenses=haiku-licenses-master
|
||||
./.github/lint-new-recipes.sh --config=haikuports.conf --licenses=haiku-licenses-master
|
||||
|
||||
Reference in New Issue
Block a user