Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to ensure QgsScrollArea is used instead of QScrollArea in ui…
… files (cherry picked from commit 8409f7f)
- Loading branch information
1 parent
364bf43
commit c96000f
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This test checks for use of QScrollArea in .ui files and suggests using QgsScrollArea instead | ||
|
||
RES= | ||
DIR=$(git rev-parse --show-toplevel) | ||
|
||
pushd "${DIR}" > /dev/null || exit | ||
|
||
FOUND=$(git grep "class=\"QScrollArea\"" -- 'src/*.ui' | grep --invert-match skip-keyword-check) | ||
|
||
if [[ ${FOUND} ]]; then | ||
echo "Base QScrollArea class used in .ui file!" | ||
echo " -> Use QgsScrollArea class instead" | ||
echo | ||
echo "${FOUND}" | ||
echo | ||
RES=1 | ||
fi | ||
|
||
|
||
popd > /dev/null || exit | ||
|
||
if [ $RES ]; then | ||
echo " *** Found QScrollArea use in ui files" | ||
exit 1 | ||
fi | ||
|