зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1460402) for lint failure on intl/locales/en-US/hyphenation/hyph_en_US.dic. CLOSED TREE
Backed out changeset c2e8fbd72ca6 (bug 1460402) Backed out changeset 3676e913dbff (bug 1460402) Backed out changeset bb12ffd4b96e (bug 1460402) Backed out changeset 3e50885329c4 (bug 1460402)
This commit is contained in:
Родитель
b94cf61acd
Коммит
a5bc0b3f70
|
@ -7,8 +7,8 @@ path:taskcluster/
|
|||
path:python/mozbuild/mozbuild/action/tooltool.py
|
||||
path:testing/config/tooltool-manifests/linux64/releng.manifest
|
||||
path:testing/mozharness/external_tools/robustcheckout.py
|
||||
path:tools/lint/spell/codespell_requirements.txt
|
||||
path:tools/lint/eslint/eslint-plugin-mozilla/manifest.tt
|
||||
path:tools/lint/eslint/manifest.tt
|
||||
path:tools/lint/python/flake8_requirements.txt
|
||||
path:tools/lint/tox/tox_requirements.txt
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
# 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/.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import
|
||||
|
||||
import subprocess
|
||||
|
||||
|
||||
def _run_pip(*args):
|
||||
"""
|
||||
Helper function that runs pip with subprocess
|
||||
"""
|
||||
try:
|
||||
subprocess.check_output(['pip'] + list(args),
|
||||
stderr=subprocess.STDOUT)
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.output)
|
||||
return False
|
||||
|
||||
|
||||
def reinstall_program(REQ_PATH):
|
||||
"""
|
||||
Try to install flake8 at the target version, returns True on success
|
||||
otherwise prints the otuput of the pip command and returns False
|
||||
"""
|
||||
if _run_pip('install', '-U',
|
||||
'--require-hashes', '-r',
|
||||
REQ_PATH):
|
||||
return True
|
||||
|
||||
return False
|
|
@ -30,8 +30,6 @@ ADD topsrcdir/tools/lint/eslint/manifest.tt /tmp/eslint.tt
|
|||
ADD topsrcdir/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt /tmp/eslint-plugin-mozilla.tt
|
||||
# %include tools/lint/python/flake8_requirements.txt
|
||||
ADD topsrcdir/tools/lint/python/flake8_requirements.txt /tmp/flake8_requirements.txt
|
||||
# %include tools/lint/spell/codespell_requirements.txt
|
||||
ADD topsrcdir/tools/lint/spell/codespell_requirements.txt /tmp/codespell_requirements.txt
|
||||
# %include tools/lint/tox/tox_requirements.txt
|
||||
ADD topsrcdir/tools/lint/tox/tox_requirements.txt /tmp/tox_requirements.txt
|
||||
RUN bash /tmp/system-setup.sh
|
||||
|
|
|
@ -10,6 +10,7 @@ mkdir -p /setup
|
|||
cd /setup
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('codespell')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('locales')
|
||||
apt_packages+=('git')
|
||||
|
@ -87,14 +88,6 @@ cd /setup
|
|||
|
||||
pip install --require-hashes -r /tmp/flake8_requirements.txt
|
||||
|
||||
###
|
||||
# codespell Setup
|
||||
###
|
||||
|
||||
cd /setup
|
||||
|
||||
pip install --require-hashes -r /tmp/codespell_requirements.txt
|
||||
|
||||
###
|
||||
# tox Setup
|
||||
###
|
||||
|
|
|
@ -42,8 +42,6 @@ ADD topsrcdir/tools/lint/eslint/manifest.tt /tmp/eslint.tt
|
|||
ADD topsrcdir/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt /tmp/eslint-plugin-mozilla.tt
|
||||
# %include tools/lint/python/flake8_requirements.txt
|
||||
ADD topsrcdir/tools/lint/python/flake8_requirements.txt /tmp/flake8_requirements.txt
|
||||
# %include tools/lint/spell/codespell_requirements.txt
|
||||
ADD topsrcdir/tools/lint/spell/codespell_requirements.txt /tmp/codespell_requirements.txt
|
||||
# %include tools/lint/tox/tox_requirements.txt
|
||||
ADD topsrcdir/tools/lint/tox/tox_requirements.txt /tmp/tox_requirements.txt
|
||||
RUN bash /tmp/system-setup.sh
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
import json
|
||||
import os
|
||||
import signal
|
||||
import subprocess
|
||||
from collections import defaultdict
|
||||
|
||||
import which
|
||||
from mozprocess import ProcessHandlerMixin
|
||||
|
||||
from mozlint import result
|
||||
from mozlint.util import pip
|
||||
from mozlint.pathutils import get_ancestors_by_name
|
||||
|
||||
|
||||
|
@ -105,6 +105,32 @@ def get_flake8_binary():
|
|||
return None
|
||||
|
||||
|
||||
def _run_pip(*args):
|
||||
"""
|
||||
Helper function that runs pip with subprocess
|
||||
"""
|
||||
try:
|
||||
subprocess.check_output(['pip'] + list(args),
|
||||
stderr=subprocess.STDOUT)
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.output)
|
||||
return False
|
||||
|
||||
|
||||
def reinstall_flake8():
|
||||
"""
|
||||
Try to install flake8 at the target version, returns True on success
|
||||
otherwise prints the otuput of the pip command and returns False
|
||||
"""
|
||||
if _run_pip('install', '-U',
|
||||
'--require-hashes', '-r',
|
||||
FLAKE8_REQUIREMENTS_PATH):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def run_process(config, cmd):
|
||||
proc = Flake8Process(config, cmd)
|
||||
proc.run()
|
||||
|
@ -116,7 +142,7 @@ def run_process(config, cmd):
|
|||
|
||||
def lint(paths, config, **lintargs):
|
||||
|
||||
if not pip.reinstall_program(FLAKE8_REQUIREMENTS_PATH):
|
||||
if not reinstall_flake8():
|
||||
print(FLAKE8_INSTALL_ERROR)
|
||||
return 1
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@ import json
|
|||
import os
|
||||
import platform
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
|
||||
from mozprocess import ProcessHandlerMixin
|
||||
|
||||
from mozlint import result
|
||||
from mozlint.util import pip
|
||||
from mozlint.pathutils import get_ancestors_by_name
|
||||
|
||||
|
||||
|
@ -98,6 +98,32 @@ class Flake8Process(ProcessHandlerMixin):
|
|||
signal.signal(signal.SIGINT, orig)
|
||||
|
||||
|
||||
def _run_pip(*args):
|
||||
"""
|
||||
Helper function that runs pip with subprocess
|
||||
"""
|
||||
try:
|
||||
subprocess.check_output([os.path.join(bindir, 'pip')] + list(args),
|
||||
stderr=subprocess.STDOUT)
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.output)
|
||||
return False
|
||||
|
||||
|
||||
def reinstall_flake8():
|
||||
"""
|
||||
Try to install flake8 at the target version, returns True on success
|
||||
otherwise prints the otuput of the pip command and returns False
|
||||
"""
|
||||
if _run_pip('install', '-U',
|
||||
'--require-hashes', '-r',
|
||||
FLAKE8_REQUIREMENTS_PATH):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def run_process(config, cmd):
|
||||
proc = Flake8Process(config, cmd)
|
||||
proc.run()
|
||||
|
@ -109,7 +135,7 @@ def run_process(config, cmd):
|
|||
|
||||
|
||||
def setup(root):
|
||||
if not pip.reinstall_program(FLAKE8_REQUIREMENTS_PATH):
|
||||
if not reinstall_flake8():
|
||||
print(FLAKE8_INSTALL_ERROR)
|
||||
return 1
|
||||
|
||||
|
|
|
@ -16,29 +16,22 @@ except ImportError:
|
|||
JSONDecodeError = ValueError
|
||||
|
||||
from mozlint import result
|
||||
from mozlint.util import pip
|
||||
from mozprocess import ProcessHandlerMixin
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
CODESPELL_REQUIREMENTS_PATH = os.path.join(here, 'codespell_requirements.txt')
|
||||
|
||||
CODESPELL_NOT_FOUND = """
|
||||
Could not find codespell! Install codespell and try again.
|
||||
Unable to locate codespell, please ensure it is installed and in
|
||||
your PATH or set the CODESPELL environment variable.
|
||||
|
||||
$ pip install -U --require-hashes -r {}
|
||||
""".strip().format(CODESPELL_REQUIREMENTS_PATH)
|
||||
|
||||
|
||||
CODESPELL_INSTALL_ERROR = """
|
||||
Unable to install correct version of codespell
|
||||
Try to install it manually with:
|
||||
$ pip install -U --require-hashes -r {}
|
||||
""".strip().format(CODESPELL_REQUIREMENTS_PATH)
|
||||
https://github.com/lucasdemarchi/codespell or your system's package manager.
|
||||
""".strip()
|
||||
|
||||
results = []
|
||||
|
||||
CODESPELL_FORMAT_REGEX = re.compile(r'(.*):(.*): (.*) ==> (.*)$')
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
|
||||
class CodespellProcess(ProcessHandlerMixin):
|
||||
def __init__(self, config, *args, **kwargs):
|
||||
|
@ -98,10 +91,6 @@ def get_codespell_binary():
|
|||
|
||||
def lint(paths, config, fix=None, **lintargs):
|
||||
|
||||
if not pip.reinstall_program(CODESPELL_REQUIREMENTS_PATH):
|
||||
print(CODESPELL_INSTALL_ERROR)
|
||||
return 1
|
||||
|
||||
binary = get_codespell_binary()
|
||||
|
||||
if not binary:
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
codespell==1.12.0 \
|
||||
--hash=sha256:f547ef6ea3af4569b0a4d3ef106ef6403f6ee574afdaa8e332650aea87301daf
|
Загрузка…
Ссылка в новой задаче