From a8a4fb69c099b82f3d35ac94e6198996971749dc Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 5 Oct 2018 15:24:36 +0100 Subject: [PATCH] [Lint] Exclude js and css from EOF fixer - When running pre-commit on all files it is picking up minified js and css files. Since prettier will format correctly the source files ignore them in end-of-file fixer. - The template files in web docs can be ignored too. - Removed the unneeded `pre-commit-hooks` dependency as pre-commit resolves that itself. - Include files fixed by pre-commit. --- .pre-commit-config.yaml | 5 +++++ README.rst | 2 +- deluge/plugins/Label/TODO | 4 ---- docs/source/core/index.rst | 2 +- docs/source/core/rpc.rst | 2 +- docs/source/interfaces/console.rst | 2 +- docs/source/interfaces/gtk.rst | 2 +- docs/source/interfaces/index.rst | 2 +- docs/source/interfaces/web.rst | 2 +- packaging/osx/deluge.modules | 1 - packaging/osx/make-app | 1 - packaging/win32/DelugeStart Theme/etc/gtk-2.0/gtkrc | 2 +- requirements-dev.txt | 1 - setup.py | 1 - 14 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95f028402..5d53fb355 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,7 @@ +exclude: > + (?x)^( + deluge/ui/web/docs/template/.*| + )$ repos: - repo: https://github.com/ambv/black rev: 18.9b0 @@ -29,6 +33,7 @@ repos: name: Fix Double-quotes - id: end-of-file-fixer name: Fix End-of-files + exclude_types: [javascript, css] - id: mixed-line-ending name: Fix Line-endings args: [--fix=auto] diff --git a/README.rst b/README.rst index 6a28e3f33..0915020c2 100644 --- a/README.rst +++ b/README.rst @@ -65,4 +65,4 @@ I can't connect to the daemon from another machine: .. |docs| image:: https://readthedocs.org/projects/deluge/badge/?version=develop :target: https://readthedocs.org/projects/deluge/?badge=develop - :alt: Documentation Status \ No newline at end of file + :alt: Documentation Status diff --git a/deluge/plugins/Label/TODO b/deluge/plugins/Label/TODO index 0ee04e2c0..c6a5daa83 100644 --- a/deluge/plugins/Label/TODO +++ b/deluge/plugins/Label/TODO @@ -9,7 +9,3 @@ *no client-side validation (could be solved by a ui.aclient exception-plugin) *expand/arrows in sidebar are disabled to save space, fix the space issue or implement an alternative *fix and move tracker_host column+status-field to core. - - - - diff --git a/docs/source/core/index.rst b/docs/source/core/index.rst index 1a45bd549..ac0760dc8 100644 --- a/docs/source/core/index.rst +++ b/docs/source/core/index.rst @@ -3,4 +3,4 @@ The Deluge Core .. toctree:: - DelugeRPC \ No newline at end of file + DelugeRPC diff --git a/docs/source/core/rpc.rst b/docs/source/core/rpc.rst index b31edc791..90f553d0f 100644 --- a/docs/source/core/rpc.rst +++ b/docs/source/core/rpc.rst @@ -102,4 +102,4 @@ Remote API ---------- .. autoclass:: deluge.__rpcapi.RpcApi - :members: \ No newline at end of file + :members: diff --git a/docs/source/interfaces/console.rst b/docs/source/interfaces/console.rst index 5781ee262..176d17ead 100644 --- a/docs/source/interfaces/console.rst +++ b/docs/source/interfaces/console.rst @@ -1,2 +1,2 @@ Deluge Console UI -================= \ No newline at end of file +================= diff --git a/docs/source/interfaces/gtk.rst b/docs/source/interfaces/gtk.rst index 51bd946ca..f8d315fe2 100644 --- a/docs/source/interfaces/gtk.rst +++ b/docs/source/interfaces/gtk.rst @@ -1,2 +1,2 @@ Deluge GTK UI -============= \ No newline at end of file +============= diff --git a/docs/source/interfaces/index.rst b/docs/source/interfaces/index.rst index 6ac5469bb..ac946cf5f 100644 --- a/docs/source/interfaces/index.rst +++ b/docs/source/interfaces/index.rst @@ -7,4 +7,4 @@ Interfaces. Gtk Interface Web Interface - Console Interface \ No newline at end of file + Console Interface diff --git a/docs/source/interfaces/web.rst b/docs/source/interfaces/web.rst index b3ac197d9..82cb3af2e 100644 --- a/docs/source/interfaces/web.rst +++ b/docs/source/interfaces/web.rst @@ -16,4 +16,4 @@ for information on creating one) you are able to specify which you want to use. There are 2 ways to enable SSL encryption in the webserver, 1 is to specify it in your configuration (accessible via the Preferences window). The other is to add '--ssl' when running the webserver, which will override the configuration -value and enable SSL. \ No newline at end of file +value and enable SSL. diff --git a/packaging/osx/deluge.modules b/packaging/osx/deluge.modules index 4090c55c7..c08180abc 100644 --- a/packaging/osx/deluge.modules +++ b/packaging/osx/deluge.modules @@ -60,4 +60,3 @@ module="T/Twisted/Twisted-12.3.0.tar.bz2"/> - diff --git a/packaging/osx/make-app b/packaging/osx/make-app index 1353aba63..9489f6c0d 100644 --- a/packaging/osx/make-app +++ b/packaging/osx/make-app @@ -47,4 +47,3 @@ find $LIBDIR/python/deluge-*.egg -name "*.py" -exec rm -f {} \; # Remove source rm -fr $LIBDIR/pygtk/2.0/*demo* echo "*** Packaging done:`du -hs $APPDIR | cut -f 1`" - diff --git a/packaging/win32/DelugeStart Theme/etc/gtk-2.0/gtkrc b/packaging/win32/DelugeStart Theme/etc/gtk-2.0/gtkrc index 7e414b469..3539a6289 100644 --- a/packaging/win32/DelugeStart Theme/etc/gtk-2.0/gtkrc +++ b/packaging/win32/DelugeStart Theme/etc/gtk-2.0/gtkrc @@ -22,4 +22,4 @@ style "user-font" { font_name="9" } -widget_class "*" style "user-font" \ No newline at end of file +widget_class "*" style "user-font" diff --git a/requirements-dev.txt b/requirements-dev.txt index d03e06313..6e92b511b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,6 @@ tox tox-venv detox pre-commit -pre-commit-hooks flake8-blind-except flake8-builtins flake8-commas diff --git a/setup.py b/setup.py index 13282f4ee..d9c7ae3f5 100755 --- a/setup.py +++ b/setup.py @@ -549,7 +549,6 @@ tests_require = [ 'flake8-mutable', 'flake8-quotes', 'pre-commit', - 'pre-commit-hooks', 'pytest', 'detox', 'tox',