From f9929f32b528162e6d54969e5a29284861848a34 Mon Sep 17 00:00:00 2001 From: Jeremy Bowman Date: Fri, 24 May 2019 08:27:54 -0400 Subject: [PATCH] Update quality threshold counts (#20681) --- cms/djangoapps/maintenance/views.py | 2 +- common/djangoapps/third_party_auth/models.py | 6 ++--- .../third_party_auth/tests/test_settings.py | 4 +-- .../tests/lms/test_progress_page.py | 7 ++--- docs/conf.py | 1 - lms/djangoapps/courseware/tests/helpers.py | 11 +++++--- .../courseware/tests/test_entrance_exam.py | 1 - .../courseware/tests/test_module_render.py | 18 +++++++------ lms/djangoapps/courseware/tests/test_views.py | 1 - .../django_comment_client/base/__init__.py | 2 +- .../notification_prefs/features/__init__.py | 0 .../features/unsubscribe.feature | 22 ---------------- .../features/unsubscribe.py | 26 ------------------- lms/djangoapps/grades/tests/utils.py | 1 - .../shoppingcart/tests/test_views.py | 15 +++++++---- .../management/commands/simulate_publish.py | 2 +- .../management/commands/notify_credentials.py | 1 - .../site_configuration/context_processors.py | 2 +- .../commands/sync_hubspot_contacts.py | 5 ++-- pavelib/paver_tests/test_paver_quality.py | 2 +- pavelib/quality.py | 4 +-- scripts/thresholds.sh | 6 ++--- scripts/xsslint_thresholds.json | 20 +++++++------- 23 files changed, 57 insertions(+), 102 deletions(-) delete mode 100644 lms/djangoapps/discussion/notification_prefs/features/__init__.py delete mode 100644 lms/djangoapps/discussion/notification_prefs/features/unsubscribe.feature delete mode 100644 lms/djangoapps/discussion/notification_prefs/features/unsubscribe.py diff --git a/cms/djangoapps/maintenance/views.py b/cms/djangoapps/maintenance/views.py index 2ef3135df3..50a8fb0e29 100644 --- a/cms/djangoapps/maintenance/views.py +++ b/cms/djangoapps/maintenance/views.py @@ -199,7 +199,7 @@ class ForcePublishCourseView(MaintenanceBaseView): self.context['msg'] = _('Force publishing course is not supported with old mongo courses.') log.warning( u'Force publishing course is not supported with old mongo courses. \ - %s attempted to force publish the course %s.', # pylint: disable=unicode-format-string + %s attempted to force publish the course %s.', request.user, course_id, exc_info=True diff --git a/common/djangoapps/third_party_auth/models.py b/common/djangoapps/third_party_auth/models.py index 5c2ce28562..809f5e41ae 100644 --- a/common/djangoapps/third_party_auth/models.py +++ b/common/djangoapps/third_party_auth/models.py @@ -622,7 +622,7 @@ class SAMLProviderConfig(ProviderConfig): 'For advanced use cases, enter a JSON object with addtional configuration. ' 'The tpa-saml backend supports {"requiredEntitlements": ["urn:..."]}, ' # pylint: disable=unicode-format-string 'which can be used to require the presence of a specific eduPersonEntitlement, ' - 'and {"extra_field_definitions": [{"name": "...", "urn": "..."},...]}, which can be ' # pylint: disable=unicode-format-string,line-too-long + 'and {"extra_field_definitions": [{"name": "...", "urn": "..."},...]}, which can be ' # pylint: disable=unicode-format-string 'used to define registration form fields and the URNs that can be used to retrieve ' 'the relevant values from the SAML response. Custom provider types, as selected ' 'in the "Identity Provider Type" field, may make use of the information stored ' @@ -709,7 +709,7 @@ class SAMLProviderConfig(ProviderConfig): data = SAMLProviderData.current(self.entity_id) if not data or not data.is_valid(): log.error( - 'No SAMLProviderData found for provider "%s" with entity id "%s" and IdP slug "%s". ' # pylint: disable=unicode-format-string,line-too-long + 'No SAMLProviderData found for provider "%s" with entity id "%s" and IdP slug "%s". ' # pylint: disable=unicode-format-string 'Run "manage.py saml pull" to fix or debug.', self.name, self.entity_id, self.slug ) @@ -824,7 +824,7 @@ class LTIProviderConfig(ProviderConfig): 'tool consumer instance should know this value. ' 'For increased security, you can avoid storing this in ' 'your database by leaving this field blank and setting ' - 'SOCIAL_AUTH_LTI_CONSUMER_SECRETS = {"consumer key": "secret", ...} ' # pylint: disable=unicode-format-string,line-too-long + 'SOCIAL_AUTH_LTI_CONSUMER_SECRETS = {"consumer key": "secret", ...} ' # pylint: disable=unicode-format-string 'in your instance\'s Django setttigs (or lms.auth.json)' ), blank=True, diff --git a/common/djangoapps/third_party_auth/tests/test_settings.py b/common/djangoapps/third_party_auth/tests/test_settings.py index e36c3c8b9d..41954154ef 100644 --- a/common/djangoapps/third_party_auth/tests/test_settings.py +++ b/common/djangoapps/third_party_auth/tests/test_settings.py @@ -27,9 +27,7 @@ _SETTINGS_MAP['DEFAULT_TEMPLATE_ENGINE'] = _SETTINGS_MAP['TEMPLATES'][0] class SettingsUnitTest(testutil.TestCase): """Unit tests for settings management code.""" - # Allow access to protected methods (or module-protected methods) under test. - # pylint: disable=protected-access - # Suppress sprurious no-member warning on fakes. + # Suppress spurious no-member warning on fakes. # pylint: disable=no-member def setUp(self): diff --git a/common/test/acceptance/tests/lms/test_progress_page.py b/common/test/acceptance/tests/lms/test_progress_page.py index 184bf23bba..eab3d3002b 100644 --- a/common/test/acceptance/tests/lms/test_progress_page.py +++ b/common/test/acceptance/tests/lms/test_progress_page.py @@ -4,10 +4,11 @@ End-to-end tests for the LMS that utilize the progress page. """ from __future__ import absolute_import -from six.moves import range + from contextlib import contextmanager import ddt +from six.moves import range from ...fixtures.course import CourseFixture, XBlockFixtureDesc from ...pages.common.logout import LogoutPage @@ -346,7 +347,7 @@ class SubsectionGradingPolicyA11yTest(SubsectionGradingPolicyBase): # Verify that y-Axis labels are aria-hidden self.assertEqual(['100%', 'true'], self.progress_page.y_tick_label(0)) self.assertEqual(['0%', 'true'], self.progress_page.y_tick_label(1)) - self.assertEqual(['Pass 50%', 'true'], self.progress_page.y_tick_label(2)) # pylint: disable=unicode-format-string,line-too-long + self.assertEqual(['Pass 50%', 'true'], self.progress_page.y_tick_label(2)) # pylint: disable=unicode-format-string # Verify x-Axis labels and sr-text self._check_tick_text(0, [u'Homework 1 - Test Subsection 1 - 50% (1/2)'], u'HW 01') @@ -407,7 +408,7 @@ class SubsectionGradingPolicyA11yTest(SubsectionGradingPolicyBase): # Verify the overall score. The first element in the array is the sr-only text, and the # second is the total text (including the sr-only text). - self.assertEqual(['Overall Score', 'Overall Score\n2%'], self.progress_page.graph_overall_score()) # pylint: disable=unicode-format-string,line-too-long + self.assertEqual(['Overall Score', 'Overall Score\n2%'], self.progress_page.graph_overall_score()) # pylint: disable=unicode-format-string class ProgressPageA11yTest(ProgressPageBaseTest): diff --git a/docs/conf.py b/docs/conf.py index 8050e1f50b..a3c8bcd0e3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -227,7 +227,6 @@ autodoc_mock_imports = [ 'MySQLdb', 'contracts', 'django_mysql', - 'lettuce', 'pymongo', ] diff --git a/lms/djangoapps/courseware/tests/helpers.py b/lms/djangoapps/courseware/tests/helpers.py index 8cde4a7761..18b557e9dd 100644 --- a/lms/djangoapps/courseware/tests/helpers.py +++ b/lms/djangoapps/courseware/tests/helpers.py @@ -10,7 +10,6 @@ from django.test import TestCase from django.test.client import Client, RequestFactory from django.urls import reverse from django.utils.timezone import now -from django.utils.translation import get_language from six import text_type from courseware.access import has_access @@ -173,7 +172,11 @@ class LoginEnrollmentTestCase(TestCase): self.user = self.activate_user(self.email) self.login(self.email, self.password) - def assert_request_status_code(self, status_code, url, method="GET", **kwargs): # pylint: disable=unicode-format-string + def assert_request_status_code(self, status_code, url, method="GET", **kwargs): + """ + Make a request to the specified URL and verify that it returns the + expected status code. + """ make_request = getattr(self.client, method.lower()) response = make_request(url, **kwargs) self.assertEqual( @@ -192,7 +195,7 @@ class LoginEnrollmentTestCase(TestCase): message_list = list(messages.get_messages(response.wsgi_request)) self.assertEqual(len(message_list), 1) self.assertIn("success", message_list[0].tags) - self.assertTrue("You have activated your account." in message_list[0].message) + self.assertIn("You have activated your account.", message_list[0].message) # ============ User creation and login ============== @@ -224,7 +227,7 @@ class LoginEnrollmentTestCase(TestCase): 'terms_of_service': 'true', 'honor_code': 'true', } - resp = self.assert_request_status_code(200, url, method="POST", data=request_data) + self.assert_request_status_code(200, url, method="POST", data=request_data) # Check both that the user is created, and inactive user = User.objects.get(email=email) self.assertFalse(user.is_active) diff --git a/lms/djangoapps/courseware/tests/test_entrance_exam.py b/lms/djangoapps/courseware/tests/test_entrance_exam.py index eec407a6b0..f9fca10357 100644 --- a/lms/djangoapps/courseware/tests/test_entrance_exam.py +++ b/lms/djangoapps/courseware/tests/test_entrance_exam.py @@ -607,7 +607,6 @@ def answer_entrance_exam_problem(course, request, problem, user=None, value=1, m course, depth=2 ) - # pylint: disable=protected-access module = get_module( user, request, diff --git a/lms/djangoapps/courseware/tests/test_module_render.py b/lms/djangoapps/courseware/tests/test_module_render.py index ab4da36de0..3b0f3c50de 100644 --- a/lms/djangoapps/courseware/tests/test_module_render.py +++ b/lms/djangoapps/courseware/tests/test_module_render.py @@ -28,7 +28,6 @@ from milestones.tests.utils import MilestonesTestCaseMixin from mock import MagicMock, Mock, patch from opaque_keys.edx.asides import AsideUsageKeyV2 from opaque_keys.edx.keys import CourseKey, UsageKey -from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user from pyquery import PyQuery from six import text_type from web_fragments.fragment import Fragment @@ -59,6 +58,7 @@ from lms.djangoapps.lms_xblock.field_data import LmsFieldData from lms.djangoapps.courseware.field_overrides import OverrideFieldData from openedx.core.djangoapps.credit.api import set_credit_requirement_status, set_credit_requirements from openedx.core.djangoapps.credit.models import CreditCourse +from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user from openedx.core.lib.courses import course_image_url from openedx.core.lib.gating import api as gating_api from openedx.core.lib.url_utils import quote_slashes @@ -1072,12 +1072,12 @@ class TestTOC(ModuleStoreTestCase): @ddt.ddt @patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True}) class TestProctoringRendering(SharedModuleStoreTestCase): + """Check the Table of Contents for a course""" @classmethod def setUpClass(cls): super(TestProctoringRendering, cls).setUpClass() cls.course_key = ToyCourseFactory.create().id - """Check the Table of Contents for a course""" def setUp(self): """ Set up the initial mongo datastores @@ -1408,6 +1408,10 @@ class TestProctoringRendering(SharedModuleStoreTestCase): class TestGatedSubsectionRendering(SharedModuleStoreTestCase, MilestonesTestCaseMixin): + """ + Test the toc for a course is rendered correctly when there is gated content + """ + @classmethod def setUpClass(cls): super(TestGatedSubsectionRendering, cls).setUpClass() @@ -1416,9 +1420,6 @@ class TestGatedSubsectionRendering(SharedModuleStoreTestCase, MilestonesTestCase cls.course.save() cls.store.update_item(cls.course, 0) - """ - Test the toc for a course is rendered correctly when there is gated content - """ def setUp(self): """ Set up the initial test data @@ -1538,7 +1539,8 @@ class TestHtmlModifiers(ModuleStoreTestCase): ) result_fragment = module.render(STUDENT_VIEW) - self.assertNotIn('div class="xblock xblock-student_view xmodule_display xmodule_HtmlModule"', result_fragment.content) + self.assertNotIn('div class="xblock xblock-student_view xmodule_display xmodule_HtmlModule"', + result_fragment.content) def test_static_link_rewrite(self): module = render.get_module( @@ -2163,7 +2165,7 @@ class TestXmoduleRuntimeEvent(TestSubmittingProblems): field_data_cache = FieldDataCache.cache_for_descriptor_descendents( self.course.id, user, self.course, depth=2) - return render.get_module( # pylint: disable=protected-access + return render.get_module( user, mock_request, self.problem.location, @@ -2236,7 +2238,7 @@ class TestRebindModule(TestSubmittingProblems): if item is None: item = self.lti - return render.get_module( # pylint: disable=protected-access + return render.get_module( user, mock_request, item.location, diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index 0bed68db6b..e3c8f95adc 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -1922,7 +1922,6 @@ class ProgressPageShowCorrectnessTests(ProgressPageBaseTests): depth=2 ) self.addCleanup(set_current_request, None) - # pylint: disable=protected-access module = get_module( self.user, get_mock_request(self.user), diff --git a/lms/djangoapps/discussion/django_comment_client/base/__init__.py b/lms/djangoapps/discussion/django_comment_client/base/__init__.py index 98828eaf98..d7ed6d3e7e 100644 --- a/lms/djangoapps/discussion/django_comment_client/base/__init__.py +++ b/lms/djangoapps/discussion/django_comment_client/base/__init__.py @@ -1,4 +1,4 @@ -# pylint: disable=missing-docstring,relative-import +# pylint: disable=missing-docstring # This import registers the ForumThreadViewedEventTransformer from __future__ import absolute_import diff --git a/lms/djangoapps/discussion/notification_prefs/features/__init__.py b/lms/djangoapps/discussion/notification_prefs/features/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lms/djangoapps/discussion/notification_prefs/features/unsubscribe.feature b/lms/djangoapps/discussion/notification_prefs/features/unsubscribe.feature deleted file mode 100644 index 9649fc1cc5..0000000000 --- a/lms/djangoapps/discussion/notification_prefs/features/unsubscribe.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: One-click unsubscribe - As a user with notifications enabled - I want to be able to unsubscribe from notifications - - Scenario: Unsubscribe when not logged in - Given I am an edX user - And I am not logged in - And I have notifications enabled - When I access my unsubscribe url - Then my notifications should be disabled - And I should see "Unsubscribe Successful!" somewhere on the page - And I should see "Click here to return to your dashboard" somewhere on the page - And I should see a link to "/dashboard" with the text "here" - - Scenario: Unsubscribe when logged in - Given I am a logged in user - And I have notifications enabled - When I access my unsubscribe url - Then my notifications should be disabled - And I should see "Unsubscribe Successful!" somewhere on the page - And I should see "Click here to return to your dashboard" somewhere on the page - And I should see a link to "/dashboard" with the text "here" diff --git a/lms/djangoapps/discussion/notification_prefs/features/unsubscribe.py b/lms/djangoapps/discussion/notification_prefs/features/unsubscribe.py deleted file mode 100644 index 6cc72db3d0..0000000000 --- a/lms/djangoapps/discussion/notification_prefs/features/unsubscribe.py +++ /dev/null @@ -1,26 +0,0 @@ -# pylint: disable=missing-docstring,unused-argument,no-member -from django.contrib.auth.models import User -from lettuce import step, world - -from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY -from openedx.core.djangoapps.user_api.preferences.api import get_user_preference, set_user_preference - -USERNAME = "robot" -UNSUB_TOKEN = "av9E-14sAP1bVBRCPbrTHQ==" - - -@step(u"I have notifications enabled") -def enable_notifications(step_): - user = User.objects.get(username=USERNAME) - set_user_preference(user, NOTIFICATION_PREF_KEY, UNSUB_TOKEN) - - -@step(u"I access my unsubscribe url") -def access_unsubscribe_url(step_): - world.visit("/notification_prefs/unsubscribe/{0}/".format(UNSUB_TOKEN)) - - -@step(u"my notifications should be disabled") -def notifications_should_be_disabled(step_): - user = User.objects.get(username=USERNAME) - assert not get_user_preference(user, NOTIFICATION_PREF_KEY) diff --git a/lms/djangoapps/grades/tests/utils.py b/lms/djangoapps/grades/tests/utils.py index 2a6fc47fa0..f02fde8b48 100644 --- a/lms/djangoapps/grades/tests/utils.py +++ b/lms/djangoapps/grades/tests/utils.py @@ -76,7 +76,6 @@ def answer_problem(course, request, problem, score=1, max_value=1): course, depth=2 ) - # pylint: disable=protected-access module = get_module( user, request, diff --git a/lms/djangoapps/shoppingcart/tests/test_views.py b/lms/djangoapps/shoppingcart/tests/test_views.py index cbb2eb1bd0..bb65a0da86 100644 --- a/lms/djangoapps/shoppingcart/tests/test_views.py +++ b/lms/djangoapps/shoppingcart/tests/test_views.py @@ -463,7 +463,8 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin): resp = self.client.post(reverse('shoppingcart.views.use_code'), {'code': self.reg_code}) self.assertEqual(resp.status_code, 404) - self.assertIn(u"Code '{0}' is not valid for any course in the shopping cart.".format(self.reg_code), resp.content) + self.assertIn(u"Code '{0}' is not valid for any course in the shopping cart.".format(self.reg_code), + resp.content) def test_cart_item_qty_greater_than_1_against_valid_reg_code(self): course_key = text_type(self.course_key) @@ -727,7 +728,7 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin): self.assertEqual(resp.status_code, 200) self.assertEquals(self.cart.orderitem_set.count(), 1) info_log.assert_called_with( - 'Coupon "%s" redemption entry removed for user "%s" for order item "%s"', # pylint: disable=unicode-format-string,line-too-long + 'Coupon "%s" redemption entry removed for user "%s" for order item "%s"', # pylint: disable=unicode-format-string self.coupon_code, self.user, str(reg_item.id) @@ -740,7 +741,8 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin): cert_item = CertificateItem.add_to_order(self.cart, self.verified_course_key, self.cost, 'honor') self.assertEquals(self.cart.orderitem_set.count(), 2) - # Delete the discounted item, corresponding coupon redemption should be removed for that particular discounted item + # Delete the discounted item, corresponding coupon redemption + # should be removed for that particular discounted item resp = self.client.post(reverse('shoppingcart.views.remove_item', args=[]), {'id': cert_item.id}) @@ -1253,7 +1255,8 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin): self.assertIn('FirstNameTesting123', resp.content) self.assertIn('80.00', resp.content) # check for the enrollment codes content - self.assertIn('Please send each professional one of these unique registration codes to enroll into the course.', resp.content) + self.assertIn('Please send each professional one of these unique registration codes to enroll into the course.', + resp.content) # fetch the newly generated registration codes course_registration_codes = CourseRegistrationCode.objects.filter(order=self.cart) @@ -2141,7 +2144,9 @@ class CSVReportViewsTest(SharedModuleStoreTestCase): def test_report_csv_bad_date(self): self.login_user() self.add_to_download_group(self.user) - response = self.client.post(reverse('payment_csv_report'), {'start_date': 'BAD', 'end_date': 'BAD', 'requested_report': 'itemized_purchase_report'}) + response = self.client.post(reverse('payment_csv_report'), + {'start_date': 'BAD', 'end_date': 'BAD', + 'requested_report': 'itemized_purchase_report'}) ((template, context), unused_kwargs) = render_mock.call_args self.assertEqual(template, 'shoppingcart/download_report.html') diff --git a/openedx/core/djangoapps/content/course_overviews/management/commands/simulate_publish.py b/openedx/core/djangoapps/content/course_overviews/management/commands/simulate_publish.py index 3d65b295c6..bcd25d4a05 100644 --- a/openedx/core/djangoapps/content/course_overviews/management/commands/simulate_publish.py +++ b/openedx/core/djangoapps/content/course_overviews/management/commands/simulate_publish.py @@ -174,7 +174,7 @@ class Command(BaseCommand): else: log.fatal( u"simulate_publish should be run as a CMS (Studio) " + - u"command, not %s (override with --force-lms).", # pylint: disable=unicode-format-string + u"command, not %s (override with --force-lms).", os.environ.get('SERVICE_VARIANT') ) sys.exit(1) diff --git a/openedx/core/djangoapps/credentials/management/commands/notify_credentials.py b/openedx/core/djangoapps/credentials/management/commands/notify_credentials.py index 21736ab50c..4ba33f252b 100644 --- a/openedx/core/djangoapps/credentials/management/commands/notify_credentials.py +++ b/openedx/core/djangoapps/credentials/management/commands/notify_credentials.py @@ -178,7 +178,6 @@ class Command(BaseCommand): if not (course_keys or options['start_date'] or options['end_date']): raise CommandError('You must specify a filter (e.g. --courses= or --start-date)') - # pylint: disable=no-member certs = get_recently_modified_certificates(course_keys, options['start_date'], options['end_date']) grades = get_recently_modified_grades(course_keys, options['start_date'], options['end_date']) diff --git a/openedx/core/djangoapps/site_configuration/context_processors.py b/openedx/core/djangoapps/site_configuration/context_processors.py index ea5cc426a2..d0c6dc08d3 100644 --- a/openedx/core/djangoapps/site_configuration/context_processors.py +++ b/openedx/core/djangoapps/site_configuration/context_processors.py @@ -9,7 +9,7 @@ from django.utils.http import urlquote_plus from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers -def configuration_context(request): # pylint: disable=unused-argument +def configuration_context(request): """ Configuration context for django templates. """ diff --git a/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py b/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py index 935364b297..a838381562 100644 --- a/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py +++ b/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py @@ -10,15 +10,14 @@ import time import traceback from datetime import datetime, timedelta -import six.moves.urllib.parse +import six.moves.urllib.parse # pylint: disable=import-error from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError -from django.utils.html import escapejs from edx_rest_api_client.client import EdxRestApiClient from slumber.exceptions import HttpClientError, HttpServerError from openedx.core.djangoapps.site_configuration.models import SiteConfiguration -from student.models import UserAttribute, UserProfile +from student.models import UserAttribute from util.query import use_read_replica_if_available HUBSPOT_API_BASE_URL = 'https://api.hubapi.com' diff --git a/pavelib/paver_tests/test_paver_quality.py b/pavelib/paver_tests/test_paver_quality.py index 10cb259d61..2709b42563 100644 --- a/pavelib/paver_tests/test_paver_quality.py +++ b/pavelib/paver_tests/test_paver_quality.py @@ -11,7 +11,7 @@ import unittest from ddt import ddt, file_data, data, unpack from mock import MagicMock, mock_open, patch from path import Path as path -from paver.easy import BuildFailure # pylint: disable=ungrouped-imports +from paver.easy import BuildFailure import pavelib.quality from pavelib.paver_tests.utils import fail_on_eslint diff --git a/pavelib/quality.py b/pavelib/quality.py index ddcdc11cc8..e52bd8c98a 100644 --- a/pavelib/quality.py +++ b/pavelib/quality.py @@ -9,10 +9,10 @@ import io import json import os import re -import six from datetime import datetime from xml.sax.saxutils import quoteattr +import six from paver.easy import BuildFailure, cmdopts, needs, sh, task from openedx.core.djangolib.markup import HTML @@ -789,7 +789,7 @@ def _extract_missing_pii_annotations(filename): ("report-dir=", "r", "Directory in which to put PII reports"), ]) @timed -def run_pii_check(options): # pylint: disable=unused-argument +def run_pii_check(options): """ Guarantee that all Django models are PII-annotated. """ diff --git a/scripts/thresholds.sh b/scripts/thresholds.sh index 426bfd469a..bd730ffb45 100755 --- a/scripts/thresholds.sh +++ b/scripts/thresholds.sh @@ -2,6 +2,6 @@ set -e export LOWER_PYLINT_THRESHOLD=1000 -export UPPER_PYLINT_THRESHOLD=2775 -export ESLINT_THRESHOLD=5590 -export STYLELINT_THRESHOLD=973 +export UPPER_PYLINT_THRESHOLD=2200 +export ESLINT_THRESHOLD=5530 +export STYLELINT_THRESHOLD=880 diff --git a/scripts/xsslint_thresholds.json b/scripts/xsslint_thresholds.json index 16c9a14526..2e65c783c6 100644 --- a/scripts/xsslint_thresholds.json +++ b/scripts/xsslint_thresholds.json @@ -2,31 +2,31 @@ "rules": { "javascript-concat-html": 160, "javascript-escape": 7, - "javascript-interpolate": 27, - "javascript-jquery-append": 72, - "javascript-jquery-html": 167, - "javascript-jquery-insert-into-target": 20, + "javascript-interpolate": 26, + "javascript-jquery-append": 68, + "javascript-jquery-html": 166, + "javascript-jquery-insert-into-target": 18, "javascript-jquery-insertion": 19, "javascript-jquery-prepend": 7, "mako-html-entities": 0, "mako-invalid-html-filter": 7, - "mako-invalid-js-filter": 112, + "mako-invalid-js-filter": 107, "mako-js-html-string": 0, "mako-js-missing-quotes": 0, - "mako-missing-default": 144, + "mako-missing-default": 139, "mako-multiple-page-tags": 0, "mako-unknown-context": 0, "mako-unparseable-expression": 0, "mako-unwanted-html-filter": 0, "python-close-before-format": 0, "python-concat-html": 3, - "python-custom-escape": 8, - "python-deprecated-display-name": 14, + "python-custom-escape": 7, + "python-deprecated-display-name": 12, "python-interpolate-html": 30, "python-parse-error": 0, "python-requires-html-or-text": 0, - "python-wrap-html": 142, + "python-wrap-html": 129, "underscore-not-escaped": 493 }, - "total": 1432 + "total": 1398 }