← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:flake8-whitespace into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:flake8-whitespace into launchpad:master.

Commit message:
flake8: Fix various trivial whitespace issues (W291, W293, W391)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/406639
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:flake8-whitespace into launchpad:master.
diff --git a/cronscripts/expire-archive-files.py b/cronscripts/expire-archive-files.py
index a87e8a0..59f3bec 100755
--- a/cronscripts/expire-archive-files.py
+++ b/cronscripts/expire-archive-files.py
@@ -17,4 +17,3 @@ if __name__ == '__main__':
     script = ArchiveExpirer(
         'expire-archive-files', dbuser=config.binaryfile_expire.dbuser)
     script.lock_and_run()
-
diff --git a/cronscripts/generate-ppa-htaccess.py b/cronscripts/generate-ppa-htaccess.py
index 7945879..e4044f2 100755
--- a/cronscripts/generate-ppa-htaccess.py
+++ b/cronscripts/generate-ppa-htaccess.py
@@ -17,4 +17,3 @@ if __name__ == '__main__':
     script = HtaccessTokenGenerator(
         'generate-ppa-htaccess', dbuser=config.generateppahtaccess.dbuser)
     script.lock_and_run()
-
diff --git a/cronscripts/language-pack-exporter.py b/cronscripts/language-pack-exporter.py
index b733593..50fc0a2 100755
--- a/cronscripts/language-pack-exporter.py
+++ b/cronscripts/language-pack-exporter.py
@@ -97,4 +97,3 @@ if __name__ == '__main__':
     script = RosettaLangPackExporter(
         'language-pack-exporter', dbuser='langpack')
     script.lock_and_run()
-
diff --git a/cronscripts/ppa-generate-keys.py b/cronscripts/ppa-generate-keys.py
index 2df6063..e580cad 100755
--- a/cronscripts/ppa-generate-keys.py
+++ b/cronscripts/ppa-generate-keys.py
@@ -17,4 +17,3 @@ if __name__ == '__main__':
     script = PPAKeyGenerator(
         "ppa-generate-keys", config.archivepublisher.dbuser)
     script.lock_and_run()
-
diff --git a/cronscripts/product-release-finder.py b/cronscripts/product-release-finder.py
index b9430c2..f1c2d3a 100755
--- a/cronscripts/product-release-finder.py
+++ b/cronscripts/product-release-finder.py
@@ -23,8 +23,8 @@ class ReleaseFinderScript(LaunchpadCronScript):
         prf = ProductReleaseFinder(self.txn, self.logger)
         prf.findReleases()
 
+
 if __name__ == "__main__":
     script = ReleaseFinderScript('productreleasefinder',
         dbuser=config.productreleasefinder.dbuser)
     script.lock_and_run()
-
diff --git a/cronscripts/update-bugtask-targetnamecaches.py b/cronscripts/update-bugtask-targetnamecaches.py
index 3a67755..907c6b6 100755
--- a/cronscripts/update-bugtask-targetnamecaches.py
+++ b/cronscripts/update-bugtask-targetnamecaches.py
@@ -24,9 +24,9 @@ class UpdateBugTaskTargetNameCaches(LaunchpadCronScript):
         updater = BugTaskTargetNameCacheUpdater(self.txn, self.logger)
         updater.run()
 
+
 if __name__ == '__main__':
     script = UpdateBugTaskTargetNameCaches(
         'launchpad-targetnamecacheupdater',
         dbuser=config.targetnamecacheupdater.dbuser)
     script.lock_and_run()
-
diff --git a/cronscripts/update-cve.py b/cronscripts/update-cve.py
index 1941605..81ac275 100755
--- a/cronscripts/update-cve.py
+++ b/cronscripts/update-cve.py
@@ -17,4 +17,3 @@ from lp.services.config import config
 if __name__ == '__main__':
     script = CVEUpdater("updatecve", config.cveupdater.dbuser)
     script.lock_and_run()
-
diff --git a/database/replication/__init__.py b/database/replication/__init__.py
index 9cd087d..be05115 100644
--- a/database/replication/__init__.py
+++ b/database/replication/__init__.py
@@ -2,4 +2,3 @@
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Slony-I replication scripts and helpers."""
-
diff --git a/database/schema/sort_sql.py b/database/schema/sort_sql.py
index d70fd42..900143c 100755
--- a/database/schema/sort_sql.py
+++ b/database/schema/sort_sql.py
@@ -51,6 +51,6 @@ def main(argv):
 
     return 0
 
+
 if __name__ == '__main__':
     sys.exit(main(sys.argv))
-
diff --git a/lib/launchpad_loggerhead/__init__.py b/lib/launchpad_loggerhead/__init__.py
index 8b13789..e69de29 100644
--- a/lib/launchpad_loggerhead/__init__.py
+++ b/lib/launchpad_loggerhead/__init__.py
@@ -1 +0,0 @@
-
diff --git a/lib/lp/code/mail/tests/test_sourcepackagerecipebuild.py b/lib/lp/code/mail/tests/test_sourcepackagerecipebuild.py
index ceec2a9..769fb61 100644
--- a/lib/lp/code/mail/tests/test_sourcepackagerecipebuild.py
+++ b/lib/lp/code/mail/tests/test_sourcepackagerecipebuild.py
@@ -29,7 +29,7 @@ expected_body = u"""\
  * Build Log: %s
  * Upload Log: 
  * Builder: http://launchpad.test/builders/bob
-"""
+"""  # noqa: W291
 
 superseded_body = u"""\
  * State: Build for superseded Source
@@ -40,7 +40,7 @@ superseded_body = u"""\
  * Build Log: 
  * Upload Log: 
  * Builder: 
-"""
+     """  # noqa: W291
 
 
 class TestSourcePackageRecipeBuildMailer(TestCaseWithFactory):
diff --git a/lib/lp/code/model/tests/test_codereviewcomment.py b/lib/lp/code/model/tests/test_codereviewcomment.py
index 4ec62d8..36c92de 100644
--- a/lib/lp/code/model/tests/test_codereviewcomment.py
+++ b/lib/lp/code/model/tests/test_codereviewcomment.py
@@ -238,7 +238,7 @@ class TestQuoteTextAsEmail(TestCase):
         expected = dedent("""\
             > This is the first line.
             > 
-            > This is the second line.""")
+            > This is the second line.""")  # noqa: W291
         self.assertEqual(expected, quote_text_as_email(value))
 
     def test_trailing_whitespace(self):
diff --git a/lib/lp/services/job/tests/test_celery.py b/lib/lp/services/job/tests/test_celery.py
index e5df169..d1000e3 100644
--- a/lib/lp/services/job/tests/test_celery.py
+++ b/lib/lp/services/job/tests/test_celery.py
@@ -267,4 +267,3 @@ class TestCeleryLaneFallback(TestCaseWithFactory):
         self.assertEqual(
             'launchpad_job_slow',
             message_drain.call_args[0][1].delivery_info['routing_key'])
-
diff --git a/lib/lp/services/librarianserver/librariangc.py b/lib/lp/services/librarianserver/librariangc.py
index 74d1a01..1a0cb30 100644
--- a/lib/lp/services/librarianserver/librariangc.py
+++ b/lib/lp/services/librarianserver/librariangc.py
@@ -534,7 +534,7 @@ class UnreferencedContentPruner:
 
     def remove_content(self, content_id):
         removed = []
-    
+
         # Remove the file from disk, if it hasn't already been.
         path = get_file_path(content_id)
         try:
@@ -543,7 +543,7 @@ class UnreferencedContentPruner:
         except OSError as e:
             if e.errno != errno.ENOENT:
                 raise
-    
+
         # Remove the file from Swift, if it hasn't already been.
         if self.swift_enabled:
             container, name = swift.swift_location(content_id)
@@ -557,11 +557,11 @@ class UnreferencedContentPruner:
                     except swiftclient.ClientException as x:
                         if x.http_status != 404:
                             raise
-    
+
         if removed:
             log.debug3(
                 "Deleted %s from %s", content_id, ' & '.join(removed))
-    
+
         elif config.librarian_server.upstream_host is None:
             # It is normal to have files in the database that
             # are not on disk if the Librarian has an upstream
diff --git a/scripts/cache-country-mirrors.py b/scripts/cache-country-mirrors.py
index f9638b2..a397bac 100755
--- a/scripts/cache-country-mirrors.py
+++ b/scripts/cache-country-mirrors.py
@@ -62,4 +62,3 @@ class CacheCountryMirrors(LaunchpadScript):
 
 if __name__ == '__main__':
     CacheCountryMirrors('cache-country-mirrors').lock_and_run()
-
diff --git a/scripts/rosetta/migrate_current_flag.py b/scripts/rosetta/migrate_current_flag.py
index a1eddcc..3e08ab9 100755
--- a/scripts/rosetta/migrate_current_flag.py
+++ b/scripts/rosetta/migrate_current_flag.py
@@ -15,7 +15,7 @@ from lp.translations.scripts.migrate_current_flag import (
 
 class MigrateTranslationFlags(LaunchpadScript):
     """Go through translations for projects and set is_current_upstream flag
- 
+
     Sets the is_current_upstream flag for all current translations in projects
     so that they appear as current in the new model.
     """
diff --git a/utilities/pgbackup.py b/utilities/pgbackup.py
index b329e16..97a2bb8 100755
--- a/utilities/pgbackup.py
+++ b/utilities/pgbackup.py
@@ -52,7 +52,7 @@ def main(options, databases):
         if os.path.exists(dest):
             log.fatal("%s already exists." % dest)
             return 1
- 
+
     for database in databases:
         dest =  os.path.join(backup_dir, '%s.%s.dump' % (database, today))
 
diff --git a/utilities/pglogwatch.py b/utilities/pglogwatch.py
index ab37634..52eee17 100755
--- a/utilities/pglogwatch.py
+++ b/utilities/pglogwatch.py
@@ -50,7 +50,7 @@ class Process(object):
 
 class Watcher(object):
     _line_re = re.compile(r"""
-        ^\d{4}-\d\d-\d\d \s \d\d:\d\d:\d\d \s 
+        ^\d{4}-\d\d-\d\d \s \d\d:\d\d:\d\d \s
         \[(?P<pid>\d+)\] \s (?P<type>LOG|ERROR|DETAIL): \s+ (?P<rest>.*)$
         """, re.X)
 
@@ -108,13 +108,13 @@ class Watcher(object):
 
         pid = int(match.group('pid'))
         rest = match.group('rest')
-        
+
         process = self.processes.get(pid, None)
         if process is None:
             process = Process(pid)
             self.processes[pid] = process
         self.previous_process = process
-        
+
         match = self._statement_re.search(rest)
         if match is not None:
             statement = match.group('statement')
@@ -161,6 +161,7 @@ class Watcher(object):
             print('[%5d] %s' % (process.pid, process.statement))
             print('        Duration: %0.3f' % (process.duration,))
 
+
 if __name__ == '__main__':
     options = get_options()
 
@@ -169,4 +170,3 @@ if __name__ == '__main__':
         watcher.run()
     except KeyboardInterrupt:
         pass
-
diff --git a/utilities/update-copyright b/utilities/update-copyright
index 2c79e9c..b0729c6 100755
--- a/utilities/update-copyright
+++ b/utilities/update-copyright
@@ -86,4 +86,3 @@ if __name__ == "__main__":
         find_and_update()
     else:
         update_files(sys.argv[1:])
-