[pitivi/thiblahute/pre_commit_ci] Run our pre commit hooks on the CI server



commit 026f50e262fe46fcaaa503512fb09982258e30df
Author: Thibault Saunier <tsaunier igalia com>
Date:   Wed May 20 15:11:48 2020 -0400

    Run our pre commit hooks on the CI server
    
    And fix some minor issues that were in the code

 .gitlab-ci.yml                       |  2 ++
 .pre-commit-config.yaml              | 13 +++++++++++++
 build/flatpak/org.pitivi.Pitivi.json |  1 +
 data/gstpresets/jpeg-raw-in-qt.gep   |  1 -
 data/gstpresets/prores-raw-in-qt.gep |  2 +-
 pitivi/dialogs/prefs.py              |  2 +-
 pitivi/utils/timeline.py             | 10 +++++-----
 7 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 15584300..133eed39 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,6 +27,7 @@ variables:
     - export BUILDDIR="\${HOME}/pitivi"
     - export CLONE_PITIVI="git clone ${CI_PROJECT_URL}.git --single-branch \${HOME}/pitivi -b 
${CI_COMMIT_REF_NAME}"
     - export BUILD_PITIVI="flatpak-builder --user --disable-rofiles-fuse ${BUILDDIR}/app 
${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache"
+    - export PRE_COMMIT_HOOK="flatpak-builder --user --disable-rofiles-fuse ${BUILDDIR}/app 
${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache --run pre-commit 
run --all-files"
 
     - env
 
@@ -83,6 +84,7 @@ build:
     - flatpak-builder --user --disable-rofiles-fuse ${FLATPAK_BUILDER_CACHE} --disable-download --ccache 
--repo=${FLATPAK_REPO} --force-clean app build/flatpak/org.pitivi.Pitivi.json --subject="Rolling update for 
pitivi master" --body="See ${CI_JOB_URL}"
     - ${RUN_IN_SANDBOX} meson mesonbuild/
     - ${RUN_IN_SANDBOX} ninja -C mesonbuild/
+    - ${RUN_IN_SANDBOX} pre-commit run --all-files
     - xvfb-run -n 32 -s "-screen 0 640x480x24" ${RUN_IN_SANDBOX} gst-validate-launcher 
$PWD/tests/ptv_testsuite.py --dump-on-failure --timeout-factor 4 --xunit-file ${XUNIT_PATH} 
--logs-dir=${CI_PROJECT_DIR}/tests-logs ${BLACKLIST}
 
     # For some reason GitLab fails to upload directories
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 17a758c4..9d2a97ec 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -27,6 +27,7 @@ repos:
         args:
           # http://www.pydocstyle.org/en/latest/error_codes.html
           - --ignore=D1,D203,D213,D401,D406,D407,D413
+        exclude: '.*pitivi/utils/extract.py$|.*pitivi/autoaligner.py$'
   - repo: https://gitlab.com/PyCQA/flake8
     rev: 3.7.9
     hooks:
@@ -35,6 +36,11 @@ repos:
           # http://flake8.pycqa.org/en/latest/user/error-codes.html
           # https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
           - --ignore=E402,E501,E722,F401,F841,W504
+        exclude: >
+          (?x)^(
+            pitivi/utils/extract.py|
+            pitivi/autoaligner.py|
+          )$
   - repo: local
     hooks:
       - id: pylint
@@ -42,6 +48,13 @@ repos:
         entry: python3 -m pylint.__main__ --rcfile=pylint.rc
         language: system
         types: [python]
+        exclude: >
+          (?x)^(
+            pitivi/utils/extract.py|
+            pitivi/autoaligner.py|
+            tests/validate-tests/manager.py|
+            bin/pitivi.in
+          )$
   - repo: https://github.com/adrienverge/yamllint.git
     rev: v1.20.0
     hooks:
diff --git a/build/flatpak/org.pitivi.Pitivi.json b/build/flatpak/org.pitivi.Pitivi.json
index 233cf32c..395c518b 100644
--- a/build/flatpak/org.pitivi.Pitivi.json
+++ b/build/flatpak/org.pitivi.Pitivi.json
@@ -7,6 +7,7 @@
     "finish-args": [
         "--socket=x11",
         "--share=ipc",
+        "--share=network",
         "--socket=pulseaudio",
         "--socket=wayland",
         "--filesystem=xdg-run/dconf",
diff --git a/data/gstpresets/jpeg-raw-in-qt.gep b/data/gstpresets/jpeg-raw-in-qt.gep
index bf3a86de..876f60a3 100644
--- a/data/gstpresets/jpeg-raw-in-qt.gep
+++ b/data/gstpresets/jpeg-raw-in-qt.gep
@@ -23,4 +23,3 @@ presence=0
 pass=0
 variableframerate=false
 preset=Quality High
-
diff --git a/data/gstpresets/prores-raw-in-qt.gep b/data/gstpresets/prores-raw-in-qt.gep
index 4081291d..8b247f77 100644
--- a/data/gstpresets/prores-raw-in-qt.gep
+++ b/data/gstpresets/prores-raw-in-qt.gep
@@ -21,4 +21,4 @@ type=video
 format=video/x-prores
 presence=0
 pass=0
-variableframerate=false
\ No newline at end of file
+variableframerate=false
diff --git a/pitivi/dialogs/prefs.py b/pitivi/dialogs/prefs.py
index d8e0c21a..14d59391 100644
--- a/pitivi/dialogs/prefs.py
+++ b/pitivi/dialogs/prefs.py
@@ -393,7 +393,7 @@ class PreferencesDialog(Loggable):
         index = 0
         for group in shortcuts_manager.groups:
             actions = shortcuts_manager.group_actions[group]
-            for action, title, _ in actions:
+            for action, title, _unused in actions:
                 item = ModelItem(self.app, action, title, group)
                 self.list_store.append(item)
                 self.action_ids[action] = index
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index d4a85cef..f8798065 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -334,11 +334,11 @@ class EditingContext(GObject.Object, Loggable):
         res = self.focus.edit([], priority, self.mode, self.edge, int(position))
         if res:
             self.app.write_action("edit-container",
-                                container_name=self.focus.get_name(),
-                                position=float(position / Gst.SECOND),
-                                edit_mode=self.mode.value_nick,
-                                edge=self.edge.value_nick,
-                                new_layer_priority=int(priority))
+                                  container_name=self.focus.get_name(),
+                                  position=float(position / Gst.SECOND),
+                                  edit_mode=self.mode.value_nick,
+                                  edge=self.edge.value_nick,
+                                  new_layer_priority=int(priority))
 
             if self.with_video:
                 if self.edge == GES.Edge.EDGE_START:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]