зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1580280
- [lint] Support Python 3 in the eslint integration r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D45438 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
6fc4da9266
Коммит
f72360bce1
|
@ -86,7 +86,8 @@ def lint(paths, config, binary=None, fix=None, setup=None, **lintargs):
|
|||
shell = True
|
||||
|
||||
orig = signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||
proc = ProcessHandler(cmd_args, env=os.environ, stream=None, shell=shell)
|
||||
proc = ProcessHandler(cmd_args, env=os.environ, stream=None,
|
||||
shell=shell, universal_newlines=True)
|
||||
proc.run()
|
||||
signal.signal(signal.SIGINT, orig)
|
||||
|
||||
|
|
|
@ -6,22 +6,22 @@
|
|||
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from filecmp import dircmp
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
from mozfile.mozfile import remove as mozfileremove
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import shutil
|
||||
import tempfile
|
||||
from distutils.version import LooseVersion, StrictVersion
|
||||
from mozbuild.util import ensure_subprocess_env
|
||||
from filecmp import dircmp
|
||||
|
||||
from mozbuild.nodeutil import (find_node_executable, find_npm_executable,
|
||||
NPM_MIN_VERSION, NODE_MIN_VERSION)
|
||||
sys.path.append(os.path.join(
|
||||
os.path.dirname(__file__), "..", "..", "..", "third_party", "python", "which"))
|
||||
from mozbuild.util import ensure_subprocess_env
|
||||
from mozfile.mozfile import remove as mozfileremove
|
||||
|
||||
|
||||
NODE_MACHING_VERSION_NOT_FOUND_MESSAGE = """
|
||||
Could not find Node.js executable later than %s.
|
||||
|
@ -233,7 +233,7 @@ def eslint_module_needs_setup():
|
|||
needs_clobber = False
|
||||
node_modules_path = os.path.join(get_project_root(), "node_modules")
|
||||
|
||||
for name, expected_data in expected_eslint_modules().iteritems():
|
||||
for name, expected_data in expected_eslint_modules().items():
|
||||
# expected_eslint_modules returns a string for the version number of
|
||||
# dependencies for installation of eslint generally, and an object
|
||||
# for our in-tree plugins (which contains the entire module info).
|
||||
|
@ -316,8 +316,8 @@ def get_possible_node_paths_win():
|
|||
|
||||
def get_version(path):
|
||||
try:
|
||||
version_str = subprocess.check_output([path, "--version"],
|
||||
stderr=subprocess.STDOUT)
|
||||
version_str = subprocess.check_output([path, "--version"], stderr=subprocess.STDOUT,
|
||||
universal_newlines=True)
|
||||
return version_str
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
return None
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
subsuite = mozlint
|
||||
|
||||
[test_eslint.py]
|
||||
skip-if = python == 3 || os == "win" || os == "mac" # node not installed on worker
|
||||
skip-if = os == "win" || os == "mac" # node not installed on worker
|
||||
[test_flake8.py]
|
||||
requirements = tools/lint/python/flake8_requirements.txt
|
||||
skip-if = os == "mac" # pip unable to find 'flake8==3.5.0'
|
||||
|
|
Загрузка…
Ссылка в новой задаче