aboutsummaryrefslogtreecommitdiffstats
path: root/build/psalm-checker.sh
blob: a56fecebe52ea57039c8ac0f3b28657134651d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

if [ -d "dist" ]; then
	missing=''
	for app in apps/*; do
		if git check-ignore "$app" -q ; then
			echo "ℹ️  Ignoring non shipped app: $app"
			continue
		fi

		grep "directory name=\"$app\"" psalm.xml 2>&1 > /dev/null
		if [ $? -ne 0 ]; then
			missing="$missing  - $app\n"
		fi
	done

	if [ "$missing"  = "" ]; then
		echo "✅ All apps will be linted by psalm"
	else
		echo "❌ Following apps are not setup for linting using psalm:"
		echo -e "$missing"
		exit 1
	fi
else
	echo "⚠️ This script needs to be executed from the root of the repository"
	exit 1
fi