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
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/',