diff options
Diffstat (limited to 'misc')
| -rwxr-xr-x | misc/hooks/pre-commit-clang-format | 7 | ||||
| -rw-r--r-- | misc/scripts/svgs_2_pngs.py | 12 | ||||
| -rwxr-xr-x | misc/travis/clang-format.sh | 2 |
3 files changed, 13 insertions, 8 deletions
diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index f7620fe2c5..0971ebe23a 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -31,7 +31,7 @@ PARSE_EXTS=true # File types to parse. Only effective when PARSE_EXTS is true. # FILE_EXTS=".c .h .cpp .hpp" -FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m" +FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m .mm .inc" # Use pygmentize instead of cat to parse diff with highlighting. # Install it with `pip install pygments` (Linux) or `easy_install Pygments` (Mac) @@ -82,6 +82,11 @@ $DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch # create one patch containing all changes to the files git diff-index --cached --diff-filter=ACMR --name-only $against -- | while read file; do + # ignore thirdparty files + if grep -q "thirdparty" <<< $file; then + continue; + fi + # ignore file if we do check for file extensions and the file # does not match any of the extensions specified in $FILE_EXTS if $PARSE_EXTS && ! matches_extension "$file"; then diff --git a/misc/scripts/svgs_2_pngs.py b/misc/scripts/svgs_2_pngs.py index b24324dcd7..0459f63bfa 100644 --- a/misc/scripts/svgs_2_pngs.py +++ b/misc/scripts/svgs_2_pngs.py @@ -16,7 +16,7 @@ last_svg_data = None SCRIPT_FOLDER = dirname(realpath(__file__)) + '/' theme_dir_base = SCRIPT_FOLDER + '../../scene/resources/default_theme/' theme_dir_source = theme_dir_base + 'source/' -icons_dir_base = SCRIPT_FOLDER + '../editor/icons/' +icons_dir_base = SCRIPT_FOLDER + '../../editor/icons/' icons_dir_2x = icons_dir_base + '2x/' icons_dir_source = icons_dir_base + 'source/' @@ -54,14 +54,14 @@ def export_icons(): out_icon_names = [name_only] # export to a png with the same file name theme_out_icon_names = [] # special cases - if special_icons.has_key(name_only): + if special_icons.get(name_only): special_icon = special_icons[name_only] if type(special_icon) is dict: if special_icon.get('avoid_self'): out_icon_names = [] - if special_icon.has_key('output_names'): + if special_icon.get('output_names'): out_icon_names += special_icon['output_names'] - if special_icon.has_key('theme_output_names'): + if special_icon.get('theme_output_names'): theme_out_icon_names += special_icon['theme_output_names'] source_path = '%s%s.svg' % (svgs_path, name_only) @@ -83,10 +83,10 @@ def export_theme(): out_icon_names = [name_only] # export to a png with the same file name # special cases - if theme_icons.has_key(name_only): + if theme_icons.get(name_only): special_icon = theme_icons[name_only] if type(special_icon) is dict: - if special_icon.has_key('output_names'): + if special_icon.get('output_names'): out_icon_names += special_icon['output_names'] source_path = '%s%s.svg' % (svgs_path, name_only) diff --git a/misc/travis/clang-format.sh b/misc/travis/clang-format.sh index 5ecc1b37d8..741d3bff1b 100755 --- a/misc/travis/clang-format.sh +++ b/misc/travis/clang-format.sh @@ -11,7 +11,7 @@ else RANGE=HEAD fi -FILES=$(git diff-tree --no-commit-id --name-only -r $RANGE | grep -v thirdparty/ | grep -e "\.cpp$" -e "\.h$" -e "\.inc$") +FILES=$(git diff-tree --no-commit-id --name-only -r $RANGE | grep -v thirdparty/ | grep -E "\.(c|h|cpp|hpp|cc|hh|cxx|m|mm|inc)$") echo "Checking files:\n$FILES" # create a random filename to store our generated patch |