Bug 1322914 - Enable flake8 linting for security/manager. r?mgoodwin draft
authorCykesiopka <cykesiopka.bmo@gmail.com>
Tue, 13 Dec 2016 00:25:45 +0800
changeset 448719 fce7692e735bc6e83e86be6a1cc2514a3c74754f
parent 448718 16f0999bbcf379ac936fa6ce0b56027cff662f5d
child 539353 24efc89cb19a25dc8d285fabb838f955fb9b6186
push id38410
push usercykesiopka.bmo@gmail.com
push dateMon, 12 Dec 2016 16:28:30 +0000
reviewersmgoodwin
bugs1322914
milestone53.0a1
Bug 1322914 - Enable flake8 linting for security/manager. r?mgoodwin Various non-conformant B2G related files are simply ignored, since it's not worth the time to update them to conform. MozReview-Commit-ID: 5QMbg5pHSbn
security/manager/.flake8
security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/nss_ctypes.py
security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py
security/manager/ssl/tests/unit/test_signed_manifest/nss_ctypes.py
security/manager/ssl/tests/unit/test_signed_manifest/sign_b2g_manifest.py
tools/lint/flake8.lint
new file mode 100644
--- /dev/null
+++ b/security/manager/.flake8
@@ -0,0 +1,14 @@
+[flake8]
+# E128: continuation line under-indented for visual indent.
+#       Best visual indent typically determined based on context.
+# E261: at least two spaces before inline comment.
+#       Not PSM style.
+# E302: expected 2 blank lines, found 1.
+#       Not really PSM style.
+ignore = E128,E261,E302
+
+# PSM style is to stick close to 80 chars, but 4 space indentation means we
+# sometimes need more space.
+max-line-length = 100
+
+filename = *.py
--- a/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/nss_ctypes.py
+++ b/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/nss_ctypes.py
@@ -1,8 +1,10 @@
+# flake8: noqa
+
 from ctypes import *
 import os
 import sys
 
 if sys.platform == 'darwin':
   libprefix = "lib"
   libsuffix = ".dylib"
 elif os.name == 'posix':
--- a/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py
+++ b/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py
@@ -1,8 +1,10 @@
+# flake8: noqa
+
 import argparse
 from base64 import b64encode
 from hashlib import sha1
 import sys
 import zipfile
 import ctypes
 
 import nss_ctypes
--- a/security/manager/ssl/tests/unit/test_signed_manifest/nss_ctypes.py
+++ b/security/manager/ssl/tests/unit/test_signed_manifest/nss_ctypes.py
@@ -1,15 +1,17 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+# flake8: noqa
+
 from ctypes import *
 import os
 import sys
 
 if sys.platform == 'darwin':
   libprefix = "lib"
   libsuffix = ".dylib"
 elif os.name == 'posix':
--- a/security/manager/ssl/tests/unit/test_signed_manifest/sign_b2g_manifest.py
+++ b/security/manager/ssl/tests/unit/test_signed_manifest/sign_b2g_manifest.py
@@ -1,15 +1,17 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+# flake8: noqa
+
 import argparse
 from base64 import b64encode
 from hashlib import sha1
 import sys
 import ctypes
 import nss_ctypes
 
 def nss_create_detached_signature(cert, dataToSign, wincx):
--- a/tools/lint/flake8.lint
+++ b/tools/lint/flake8.lint
@@ -172,16 +172,17 @@ def lint(files, **lintargs):
     return results
 
 
 LINTER = {
     'name': "flake8",
     'description': "Python linter",
     'include': [
         'python/mozlint',
+        'security/manager',
         'taskcluster',
         'testing/firefox-ui',
         'testing/marionette/client',
         'testing/marionette/harness',
         'testing/marionette/puppeteer',
         'testing/mozbase',
         'testing/mochitest',
         'testing/talos/',