@ -9,13 +9,13 @@ echo -e "\n${ANSI_GREEN}shellcheck results"
echo -e " \\n ${ ANSI_GREEN } Checking for unscaled sizes "
echo -e " \\n ${ ANSI_GREEN } Checking for unscaled sizes "
# stick `|| true` at the end to prevent Travis exit on failed command
# stick `|| true` at the end to prevent Travis exit on failed command
unscaled_size_check = $( grep -nr --include= *.lua --exclude= koptoptions.lua --exclude-dir= base --exclude-dir= install --exclude-dir= keyboardlayouts --exclude-dir= *arm* "\\(padding\\|margin\\|bordersize\\|width\\|height\\|radius\\|linesize\\) = [0-9]\\{1,2\\}" | grep -v '= 0' | grep -v '= [0-9]/[0-9]' | grep -Ev '(default_option_height|default_option_padding)' | grep -v scaleBySize || true )
unscaled_size_check = $( grep -nr --include= *.lua --exclude= koptoptions.lua --exclude-dir= base --exclude-dir= luajit-rocks --exclude-dir= install --exclude-dir= keyboardlayouts --exclude-dir= *arm* "\\(padding\\|margin\\|bordersize\\|width\\|height\\|radius\\|linesize\\) = [0-9]\\{1,2\\}" | grep -v '= 0' | grep -v '= [0-9]/[0-9]' | grep -Ev '(default_option_height|default_option_padding)' | grep -v scaleBySize || true )
# Also check Geom objects; for legibility two regular expressions rather than
# Also check Geom objects; for legibility two regular expressions rather than
# one enormous indecipharable blob.
# one enormous indecipharable blob.
unscaled_size_check_geom = $( grep -E -nr --include= *.lua --exclude= gesturerange_spec.lua --exclude-dir= base --exclude-dir= *arm* 'Geom:new{.+ [wh] = [0-9]{1,4}' | grep -Ev '[wh] = 0' | grep -v '= [0-9]/[0-9]' | grep -v scaleBySize || true )
unscaled_size_check_geom = $( grep -E -nr --include= *.lua --exclude= gesturerange_spec.lua --exclude-dir= base --exclude-dir= luajit-rocks --exclude-dir= *arm* 'Geom:new{.+ [wh] = [0-9]{1,4}' | grep -Ev '[wh] = 0' | grep -v '= [0-9]/[0-9]' | grep -v scaleBySize || true )
if [ " ${ unscaled_size_check } " ] || [ " ${ unscaled_size_check_geom } " ] ; then
if [ " ${ unscaled_size_check } " ] || [ " ${ unscaled_size_check_geom } " ] ; then
echo -e " \\n ${ ANSI_RED } Warning: it looks like you might be using unscaled sizes.\\nIt is almost always preferable to defer to one of the predefined sizes in ui. element s.commonu i in the following files:"
echo -e " \\n ${ ANSI_RED } Warning: it looks like you might be using unscaled sizes.\\nIt is almost always preferable to defer to one of the predefined sizes in ui. size in the following files:"
echo " ${ unscaled_size_check } "
echo " ${ unscaled_size_check } "
echo " ${ unscaled_size_check_geom } "
echo " ${ unscaled_size_check_geom } "
exit 1
exit 1