pre-commit.hook 2.4 KB
Newer Older
1
#!/usr/bin/env bash
2

3
RCFILE=$(git rev-parse --show-toplevel)/docs/pylint.rc
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
IGNORED_FILES="
bin/pitivi.in
pitivi/application.py
pitivi/autoaligner.py
pitivi/check.py
pitivi/clipproperties.py
pitivi/configure.py
pitivi/dialogs/clipmediaprops.py
pitivi/dialogs/depsmanager.py
pitivi/dialogs/filelisterrordialog.py
pitivi/dialogs/prefs.py
pitivi/dialogs/startupwizard.py
pitivi/effects.py
pitivi/mainwindow.py
pitivi/mediafilespreviewer.py
pitivi/medialibrary.py
pitivi/preset.py
pitivi/project.py
pitivi/render.py
pitivi/settings.py
pitivi/timeline/elements.py
pitivi/timeline/layer.py
pitivi/timeline/ruler.py
pitivi/timeline/timeline.py
pitivi/titleeditor.py
pitivi/transitions.py
pitivi/undo/project.py
pitivi/undo/timeline.py
pitivi/undo/undo.py
pitivi/utils/extract.py
pitivi/utils/loggable.py
pitivi/utils/misc.py
pitivi/utils/pipeline.py
pitivi/utils/proxy.py
pitivi/utils/ripple_update_group.py
pitivi/utils/system.py
pitivi/utils/threads.py
pitivi/utils/timeline.py
pitivi/utils/ui.py
pitivi/utils/validate.py
pitivi/utils/widgets.py
pitivi/viewer/move_scale_overlay.py
pitivi/viewer/overlay_stack.py
pitivi/viewer/title_overlay.py
pitivi/viewer/viewer.py
tests/common.py
tests/test_check.py
tests/test_clipproperties.py
tests/test_common.py
tests/test_log.py
tests/test_media_library.py
tests/test_prefs.py
tests/test_preset.py
tests/test_previewers.py
tests/test_project.py
tests/test_system.py
tests/test_timeline_layer.py
tests/test_timeline_timeline.py
tests/test_undo.py
tests/test_undo_project.py
tests/test_undo_timeline.py
tests/test_utils.py
tests/test_utils_timeline.py
tests/test_widgets.py
69 70
tests/validate-tests/manager.py
tests/validate-tests/suite.py
71 72
win32/configure.py
win32/pitivi
73 74 75 76 77 78
"

git-pylint-commit-hook --help |grep ignore > /dev/null 2>&1

if [ $? -ne 0 ]; then
  echo "Your git-pylint-commit-hook version can't ignore files that have not been fixed yet"
79 80
  echo "Use instead our fork:"
  echo "    $ pip install git+git://github.com/thiblahute/git-pylint-commit-hook.git"
81 82 83 84 85 86
  echo ""
elif [ -z $PYLINT ]; then
  IGNORE_ARGS=''
  for f in $IGNORED_FILES; do
    IGNORE_ARGS="$IGNORE_ARGS --ignore=$f"
  done
87 88
  echo "Pylint ignoring files:$IGNORED_FILES" | tr "\n" " "
  echo
89 90
fi

91 92
export PYTHONPATH=$(git rev-parse --show-toplevel)/pitivi/coptimizations/.libs:$PYTHONPATH

93
git-pylint-commit-hook --pylintrc=$RCFILE $IGNORE_ARGS --limit=10.0 --suppress-report &&\
94
  git_pep8_commit_hook --pep8-params="--repeat --ignore=E501,E128"