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

3 4 5 6 7 8 9
if [ -z "${PITIVI_REPO_DIR}" ]; then
    echo "ERROR: You're not in the Pitivi development environment. Run `source bin/pitivi-env` to enter it. See http://developer.pitivi.org/HACKING.html for details."
    exit 1
fi

TOPLEVEL=$(git rev-parse --show-toplevel)
RCFILE=$TOPLEVEL/docs/pylint.rc
10

11 12 13 14 15 16 17 18 19 20
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/filelisterrordialog.py
pitivi/dialogs/prefs.py
21
pitivi/editorperspective.py
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 69 70
pitivi/effects.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_common.py
tests/test_log.py
tests/test_media_library.py
tests/test_prefs.py
tests/test_preset.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
71 72
tests/validate-tests/manager.py
tests/validate-tests/suite.py
73 74
win32/configure.py
win32/pitivi
75 76
"

77 78
IGNORE_ARGS=""
for f in $IGNORED_FILES; do
79
    IGNORE_ARGS="$IGNORE_ARGS --ignore=$f"
80 81 82 83 84 85
done
echo "Pylint ignoring files:$IGNORED_FILES" | tr "\n" " "
echo

export PYTHONPATH=$TOPLEVEL/pitivi/coptimizations/.libs:$PYTHONPATH

86
git-pylint-commit-hook --pylint="$TOPLEVEL/build/flatpak/pitivi-flatpak" --pylint-params="pylint" --pylintrc=$RCFILE $IGNORE_ARGS --limit=10.0 --suppress-report || exit 1
87

88
git_pep8_commit_hook --pep8-params="--repeat --ignore=E501,E128" || exit 1
89

90
pre-commit run --config .pre-commit-config.yaml || exit 1