Merge pull request #26320 from edx/bom-2313
Applied pylint-amnesty to {docs, import_shims, pavelib}
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*- # lint-amnesty, pylint: disable=missing-module-docstring
|
||||
#
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
@@ -25,7 +25,7 @@ import edx_theme
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = u'Open edX REST APIs'
|
||||
copyright = edx_theme.COPYRIGHT
|
||||
copyright = edx_theme.COPYRIGHT # lint-amnesty, pylint: disable=redefined-builtin
|
||||
author = edx_theme.AUTHOR
|
||||
|
||||
# The short X.Y version
|
||||
|
||||
@@ -8,8 +8,8 @@ import all the Studio code.
|
||||
import os
|
||||
|
||||
if os.environ['EDX_PLATFORM_SETTINGS'] == 'devstack_docker':
|
||||
from lms.envs.devstack_docker import *
|
||||
from cms.envs.devstack_docker import (
|
||||
from lms.envs.devstack_docker import * # lint-amnesty, pylint: disable=wildcard-import
|
||||
from cms.envs.devstack_docker import ( # lint-amnesty, pylint: disable=unused-import
|
||||
ADVANCED_PROBLEM_TYPES,
|
||||
COURSE_IMPORT_EXPORT_STORAGE,
|
||||
LIBRARY_AUTHORING_MICROFRONTEND_URL,
|
||||
@@ -18,7 +18,7 @@ if os.environ['EDX_PLATFORM_SETTINGS'] == 'devstack_docker':
|
||||
UPDATE_SEARCH_INDEX_JOB_QUEUE,
|
||||
)
|
||||
else:
|
||||
from lms.envs.devstack import *
|
||||
from lms.envs.devstack import * # lint-amnesty, pylint: disable=wildcard-import
|
||||
from cms.envs.devstack import (
|
||||
ADVANCED_PROBLEM_TYPES,
|
||||
COURSE_IMPORT_EXPORT_STORAGE,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*- # lint-amnesty, pylint: disable=missing-module-docstring
|
||||
#
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
@@ -7,7 +7,7 @@
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
|
||||
import datetime
|
||||
import datetime # lint-amnesty, pylint: disable=unused-import
|
||||
import os
|
||||
import sys
|
||||
from subprocess import check_call
|
||||
@@ -45,7 +45,7 @@ django.setup()
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = u'edx-platform'
|
||||
copyright = edx_theme.COPYRIGHT
|
||||
copyright = edx_theme.COPYRIGHT # lint-amnesty, pylint: disable=redefined-builtin
|
||||
author = edx_theme.AUTHOR
|
||||
|
||||
# The short X.Y version
|
||||
@@ -278,7 +278,7 @@ def update_settings_module(service='lms'):
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = settings_module
|
||||
|
||||
|
||||
def on_init(app): # pylint: disable=unused-argument
|
||||
def on_init(app): # lint-amnesty, pylint: disable=redefined-outer-name, unused-argument
|
||||
"""
|
||||
Run sphinx-apidoc after Sphinx initialization.
|
||||
|
||||
@@ -325,7 +325,7 @@ def on_init(app): # pylint: disable=unused-argument
|
||||
check_call(args)
|
||||
|
||||
|
||||
def setup(app):
|
||||
def setup(app): # lint-amnesty, pylint: disable=redefined-outer-name
|
||||
"""Sphinx extension: run sphinx-apidoc."""
|
||||
event = 'builder-inited'
|
||||
app.connect(event, on_init)
|
||||
|
||||
@@ -5,4 +5,4 @@ from import_shims.warn import warn_deprecated_import
|
||||
|
||||
warn_deprecated_import('student.management.commands.export_staff_users', 'common.djangoapps.student.management.commands.export_staff_users')
|
||||
|
||||
from common.djangoapps.student.management.commands.export_staff_users import *
|
||||
from common.djangoapps.student.management.commands.export_staff_users import * # lint-amnesty, pylint: disable=import-error, no-name-in-module
|
||||
|
||||
@@ -5,4 +5,4 @@ from import_shims.warn import warn_deprecated_import
|
||||
|
||||
warn_deprecated_import('student.management.tests.test_export_staff_users', 'common.djangoapps.student.management.tests.test_export_staff_users')
|
||||
|
||||
from common.djangoapps.student.management.tests.test_export_staff_users import *
|
||||
from common.djangoapps.student.management.tests.test_export_staff_users import * # lint-amnesty, pylint: disable=import-error, no-name-in-module
|
||||
|
||||
@@ -5,4 +5,4 @@ from import_shims.warn import warn_deprecated_import
|
||||
|
||||
warn_deprecated_import('student.management.commands.export_staff_users', 'common.djangoapps.student.management.commands.export_staff_users')
|
||||
|
||||
from common.djangoapps.student.management.commands.export_staff_users import *
|
||||
from common.djangoapps.student.management.commands.export_staff_users import * # lint-amnesty, pylint: disable=import-error, no-name-in-module
|
||||
|
||||
@@ -5,4 +5,4 @@ from import_shims.warn import warn_deprecated_import
|
||||
|
||||
warn_deprecated_import('student.management.tests.test_export_staff_users', 'common.djangoapps.student.management.tests.test_export_staff_users')
|
||||
|
||||
from common.djangoapps.student.management.tests.test_export_staff_users import *
|
||||
from common.djangoapps.student.management.tests.test_export_staff_users import * # lint-amnesty, pylint: disable=import-error, no-name-in-module
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""
|
||||
""" # lint-amnesty, pylint: disable=django-not-configured
|
||||
Utilities for warning about deprecated imports temporarily supported by
|
||||
the import_shim/ system.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""
|
||||
""" # lint-amnesty, pylint: disable=django-not-configured
|
||||
paver commands
|
||||
"""
|
||||
|
||||
|
||||
@@ -879,7 +879,7 @@ def watch_assets(options):
|
||||
default_wait = [str(DEFAULT_OBSERVER_TIMEOUT)]
|
||||
wait = float(get_parsed_option(options, 'wait', default_wait)[0])
|
||||
|
||||
if not theme_dirs and themes:
|
||||
if not theme_dirs and themes: # lint-amnesty, pylint: disable=no-else-raise
|
||||
# We can not add theme sass watchers without knowing the directory that contains the themes.
|
||||
raise ValueError('theme-dirs must be provided for watching theme sass.')
|
||||
else:
|
||||
|
||||
@@ -92,7 +92,7 @@ def i18n_dummy():
|
||||
"pavelib.prereqs.install_prereqs",
|
||||
)
|
||||
@timed
|
||||
def i18n_compilejs(options):
|
||||
def i18n_compilejs(options): # lint-amnesty, pylint: disable=unused-argument
|
||||
"""
|
||||
Generating djangojs.js files using django-statici18n
|
||||
"""
|
||||
@@ -260,7 +260,7 @@ def i18n_robot_push():
|
||||
"""
|
||||
Extract new strings, and push to transifex
|
||||
"""
|
||||
pass
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
|
||||
@task
|
||||
@@ -323,7 +323,7 @@ def find_release_resources():
|
||||
if len(resources) == 2:
|
||||
return resources
|
||||
|
||||
if not resources:
|
||||
if not resources: # lint-amnesty, pylint: disable=no-else-raise
|
||||
raise ValueError("You need two release-* resources defined to use this command.")
|
||||
else:
|
||||
msg = "Strange Transifex config! Found these release-* resources:\n" + "\n".join(resources)
|
||||
|
||||
@@ -60,7 +60,7 @@ def test_js(options):
|
||||
test_suite = JsTestSuite(suite, mode=mode, with_coverage=coverage, port=port, skip_clean=skip_clean)
|
||||
test_suite.run()
|
||||
|
||||
if (suite == 'jest-snapshot') or (suite == 'all'):
|
||||
if (suite == 'jest-snapshot') or (suite == 'all'): # lint-amnesty, pylint: disable=consider-using-in
|
||||
test_suite = JestSnapshotTestSuite('jest')
|
||||
test_suite.run()
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ def do_nothing():
|
||||
"""
|
||||
Don't do anything, for replacing prerequisite tasks we want to skip.
|
||||
"""
|
||||
pass
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
|
||||
class FindReleaseResourcesTest(unittest.TestCase):
|
||||
|
||||
@@ -70,7 +70,7 @@ def fail_on_eslint(*args, **kwargs):
|
||||
to fail, since that is what is going to fail when we pass in a
|
||||
percentage ("p") requirement.
|
||||
"""
|
||||
if "eslint" in args[0]:
|
||||
if "eslint" in args[0]: # lint-amnesty, pylint: disable=no-else-raise
|
||||
raise BuildFailure('Subprocess return code: 1')
|
||||
else:
|
||||
if kwargs.get('capture', False):
|
||||
@@ -91,7 +91,7 @@ def unexpected_fail_on_npm_install(*args, **kwargs): # pylint: disable=unused-a
|
||||
For our tests, we need the call for diff-quality running pycodestyle reports to fail, since that is what
|
||||
is going to fail when we pass in a percentage ("p") requirement.
|
||||
"""
|
||||
if ["npm", "install", "--verbose"] == args[0]:
|
||||
if ["npm", "install", "--verbose"] == args[0]: # lint-amnesty, pylint: disable=no-else-raise
|
||||
raise BuildFailure('Subprocess return code: 50')
|
||||
else:
|
||||
return
|
||||
|
||||
@@ -10,7 +10,7 @@ import subprocess
|
||||
import sys
|
||||
from distutils import sysconfig
|
||||
|
||||
from paver.easy import BuildFailure, sh, task
|
||||
from paver.easy import BuildFailure, sh, task # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
from .utils.envs import Env
|
||||
from .utils.timer import timed
|
||||
@@ -340,7 +340,7 @@ def log_installed_python_prereqs():
|
||||
sh("pip freeze > {}".format(Env.GEN_LOG_DIR + "/pip_freeze.log"))
|
||||
|
||||
|
||||
def print_devstack_warning():
|
||||
def print_devstack_warning(): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
if Env.USING_DOCKER: # pragma: no cover
|
||||
print("********************************************************************************")
|
||||
print("* WARNING: Mac users should run this from both the lms and studio shells")
|
||||
|
||||
@@ -786,7 +786,7 @@ def run_pii_check(options):
|
||||
print("-" * 45)
|
||||
run_output_file = str(output_file).format(env_name.lower())
|
||||
sh(
|
||||
"mkdir -p {} && "
|
||||
"mkdir -p {} && " # lint-amnesty, pylint: disable=duplicate-string-formatting-argument
|
||||
"export DJANGO_SETTINGS_MODULE={}; "
|
||||
"code_annotations django_find_annotations "
|
||||
"--config_file .pii_annotations.yml --report_path {} --app_name {} "
|
||||
|
||||
@@ -39,7 +39,7 @@ def run_server(
|
||||
"""
|
||||
if system not in ['lms', 'studio']:
|
||||
print("System must be either lms or studio", file=sys.stderr)
|
||||
exit(1)
|
||||
exit(1) # lint-amnesty, pylint: disable=consider-using-sys-exit
|
||||
|
||||
if not settings:
|
||||
settings = DEFAULT_SETTINGS
|
||||
|
||||
@@ -18,7 +18,7 @@ def kill_process(proc):
|
||||
Kill the process `proc` created with `subprocess`.
|
||||
"""
|
||||
p1_group = psutil.Process(proc.pid)
|
||||
child_pids = p1_group.get_children(recursive=True)
|
||||
child_pids = p1_group.get_children(recursive=True) # lint-amnesty, pylint: disable=no-member
|
||||
|
||||
for child_pid in child_pids:
|
||||
os.kill(child_pid.pid, signal.SIGKILL)
|
||||
@@ -110,7 +110,7 @@ def run_background_process(cmd, out_log=None, err_log=None, cwd=None):
|
||||
killed properly.
|
||||
"""
|
||||
p1_group = psutil.Process(proc.pid)
|
||||
child_pids = p1_group.get_children(recursive=True)
|
||||
child_pids = p1_group.get_children(recursive=True) # lint-amnesty, pylint: disable=no-member
|
||||
|
||||
for child_pid in child_pids:
|
||||
os.kill(child_pid.pid, signal.SIGINT)
|
||||
|
||||
@@ -146,7 +146,7 @@ def is_mysql_running():
|
||||
"""
|
||||
# We need to check whether or not mysql is running as a process
|
||||
# even if it is not daemonized.
|
||||
with open(os.devnull, 'w') as os_devnull: # pylint: disable=W6005
|
||||
with open(os.devnull, 'w') as os_devnull: # lint-amnesty, pylint: disable=bad-option-value
|
||||
#pgrep returns the PID, which we send to /dev/null
|
||||
returncode = subprocess.call("pgrep mysqld", stdout=os_devnull, shell=True)
|
||||
return returncode == 0
|
||||
@@ -212,4 +212,4 @@ def check_services():
|
||||
"""
|
||||
Check that all required services are running
|
||||
"""
|
||||
pass
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
Reference in New Issue
Block a user