From afba045c296c6edf49406620e28aad39681d4c9e Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Wed, 30 Nov 2016 17:05:01 -0600 Subject: [PATCH] add line-to-long check --- packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py | 3 ++- packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py | 8 +++++--- packaging/osx/lbry-osx-app/setup_app.sh | 3 +-- .../travis/install_dependencies_and_run_tests.sh | 5 +---- packaging/windows/test.ps1 | 2 +- run_pylint.sh | 11 +++++++++++ 6 files changed, 21 insertions(+), 11 deletions(-) create mode 100755 run_pylint.sh diff --git a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py index 3915add44..1a211aa36 100644 --- a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py +++ b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py @@ -55,7 +55,8 @@ class LBRYDaemonApp(AppKit.NSApplication): def openui_(self, sender): webbrowser.open(settings.UI_ADDRESS) - # this code is from the example https://pythonhosted.org/pyobjc/examples/Cocoa/Twisted/WebServicesTool/index.html + # this code is from the example + # https://pythonhosted.org/pyobjc/examples/Cocoa/Twisted/WebServicesTool/index.html def applicationShouldTerminate_(self, sender): if reactor.running: log.info('Stopping twisted event loop') diff --git a/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py b/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py index 82df8bc38..68bc00277 100644 --- a/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py +++ b/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py @@ -12,7 +12,8 @@ def LBRYNotify(message): notification.setInformativeText_(message) notification.setUserInfo_({}) notification.setSoundName_("NSUserNotificationDefaultSoundName") - notification.setDeliveryDate_(Foundation.NSDate.dateWithTimeInterval_sinceDate_(0, Foundation.NSDate.date())) + notification.setDeliveryDate_( + Foundation.NSDate.dateWithTimeInterval_sinceDate_(0, Foundation.NSDate.date())) NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification) @@ -25,5 +26,6 @@ def notify(title, subtitle, info_text, delay=0, sound=False, userInfo=None): notification.setUserInfo_(userInfo) if sound: notification.setSoundName_("NSUserNotificationDefaultSoundName") - notification.setDeliveryDate_(Foundation.NSDate.dateWithTimeInterval_sinceDate_(delay, Foundation.NSDate.date())) - NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification) \ No newline at end of file + notification.setDeliveryDate_( + Foundation.NSDate.dateWithTimeInterval_sinceDate_(delay, Foundation.NSDate.date())) + NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification) diff --git a/packaging/osx/lbry-osx-app/setup_app.sh b/packaging/osx/lbry-osx-app/setup_app.sh index eae3ae058..d4f35754e 100755 --- a/packaging/osx/lbry-osx-app/setup_app.sh +++ b/packaging/osx/lbry-osx-app/setup_app.sh @@ -60,8 +60,7 @@ pip install -r requirements.txt pip install pyOpenSSL pip install pylint -pylint -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils \ - --enable=unused-import --enable=bad-whitespace lbrynet packaging/osx/lbry-osx-app/lbrygui/ +./run_pylint.sh packaging/osx/lbry-osx-app/lbrygui/ python setup.py install diff --git a/packaging/travis/install_dependencies_and_run_tests.sh b/packaging/travis/install_dependencies_and_run_tests.sh index f2e5fac66..0a36c36a0 100755 --- a/packaging/travis/install_dependencies_and_run_tests.sh +++ b/packaging/travis/install_dependencies_and_run_tests.sh @@ -43,7 +43,4 @@ pip install mock pylint coveralls coverage run --source=lbrynet `which trial` tests coveralls -# Ignoring distutils because: https://github.com/PyCQA/pylint/issues/73 -# TODO: as code quality improves, make pylint be more strict -pylint -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils \ - --enable=unused-import --enable=bad-whitespace lbrynet +./run_pylint.sh diff --git a/packaging/windows/test.ps1 b/packaging/windows/test.ps1 index 29534d8a0..8dc934562 100644 --- a/packaging/windows/test.ps1 +++ b/packaging/windows/test.ps1 @@ -2,5 +2,5 @@ C:\Python27\Scripts\pip.exe install mock C:\Python27\Scripts\pip.exe install pylint C:\Python27\python.exe C:\Python27\Scripts\trial.py C:\projects\lbry\tests\unit if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -C:\Python27\Scripts\pylint.exe -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import --enable=bad-whitespace lbrynet packaging/windows/lbry-win32-app/LBRYWin32App.py +C:\Python27\Scripts\pylint.exe -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import --enable=bad-whitespace --enable=line-too-long lbrynet packaging/windows/lbry-win32-app/LBRYWin32App.py if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } diff --git a/run_pylint.sh b/run_pylint.sh new file mode 100755 index 000000000..41618b4fd --- /dev/null +++ b/run_pylint.sh @@ -0,0 +1,11 @@ +#! /bin/bash + + +# Ignoring distutils because: https://github.com/PyCQA/pylint/issues/73 +# TODO: as code quality improves, make pylint be more strict +pylint -E --disable=inherit-non-class --disable=no-member \ + --ignored-modules=distutils \ + --enable=unused-import \ + --enable=bad-whitespace \ + --enable=line-too-long \ + lbrynet $@