mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
This test checks that brace initializers are never used for QVariant variables. On some compilers the value will be converted to a list. and on others a list of lists. Always use = initialization to avoid this ambiguity!
13 lines
516 B
Bash
Executable File
13 lines
516 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# This test checks that brace initializers are never used for QVariant variables. On some compilers the value will be
|
|
# converted to a list, on others a list of lists.
|
|
# Always use = initialization to avoid this ambiguity!
|
|
|
|
if git grep -P 'QVariant(?!Map|List)[^\(\)&>:]+ {' &> /dev/null; then
|
|
echo ' *** Brace initializers should never be used for QVariant variables -- the value may become a list of lists on some compilers'
|
|
git grep -n -P 'QVariant(?!Map|List)[^\(\)&>:]+ {'
|
|
exit 1
|
|
fi
|
|
|