diff --git a/lti_consumer/models.py b/lti_consumer/models.py index 3bde1ff87ae2ced4af6951c2bb12d7d69a158b90..17b32bf5640c23fa4200e3e8df162caca89227ea 100644 --- a/lti_consumer/models.py +++ b/lti_consumer/models.py @@ -332,19 +332,19 @@ class LtiConfiguration(models.Model): @property def pii_share_username(self): - return self.lti_config.get('pii_share_username', False) + return self.lti_config.get('pii_share_username', False) # pylint: disable=no-member @pii_share_username.setter def pii_share_username(self, value): - self.lti_config['pii_share_username'] = value + self.lti_config['pii_share_username'] = value # pylint: disable=unsupported-assignment-operation @property def pii_share_email(self): - return self.lti_config.get('pii_share_email', False) + return self.lti_config.get('pii_share_email', False) # pylint: disable=no-member @pii_share_email.setter def pii_share_email(self, value): - self.lti_config['pii_share_email'] = value + self.lti_config['pii_share_email'] = value # pylint: disable=unsupported-assignment-operation def __str__(self): return f"[{self.config_store}] {self.version} - {self.location}" diff --git a/pylintrc b/pylintrc index fd5329ef6617ff5819aa74a41867b0792a9c9288..f87049ec0330d6507f570e3120e93a0ab39fa163 100644 --- a/pylintrc +++ b/pylintrc @@ -9,7 +9,7 @@ # you want to make a central change that applies to all repos using edx-lint. # # Note: If your pylintrc file is simply out-of-date relative to the latest -# pylintrc rules in edx-lint, ensure you have the latest edx-lint installed +# pylintrc in edx-lint, ensure you have the latest edx-lint installed # and then follow the steps for a "LOCAL CHANGE". # # LOCAL CHANGE: @@ -36,19 +36,16 @@ # # 3. Run (in edx-lint): # -# # uses pylintrc_tweaks from edx-lint for linting in edx-lint -# # NOTE: Use Python 3.x, which no longer includes comments in the output file # $ edx_lint write pylintrc # # 4. Make a new version of edx_lint, submit and review a pull request with the -# pylintrc update, and after merging, update the edx-lint version by -# creating a new tag in the repo (uses pbr). +# pylintrc update, and after merging, update the edx-lint version and +# publish the new version. # # 5. In your local repo, install the newer version of edx-lint. # # 6. Run: # -# # uses local pylintrc_tweaks # $ edx_lint write pylintrc # # 7. This will modify the local file. Submit a pull request to get it @@ -67,298 +64,328 @@ # SERIOUSLY. # # ------------------------------ +# Generated by edx-lint version: 5.2.0 +# ------------------------------ [MASTER] -ignore = +ignore = persistent = yes load-plugins = edx_lint.pylint,pylint_django,pylint_celery [MESSAGES CONTROL] -enable = +enable = blacklisted-name, line-too-long, - - syntax-error, - init-is-generator, - return-in-init, - function-redefined, - not-in-loop, - return-outside-function, - yield-outside-function, - return-arg-in-generator, - nonexistent-operator, - duplicate-argument-name, + abstract-class-instantiated, - bad-reversed-sequence, - continue-in-finally, - method-hidden, + abstract-method, access-member-before-definition, - no-method-argument, - no-self-argument, - invalid-slots-object, + anomalous-backslash-in-string, + anomalous-unicode-escape-in-string, + arguments-differ, + assert-on-tuple, assigning-non-slot, - invalid-slots, - inherit-non-class, - inconsistent-mro, + assignment-from-no-return, + assignment-from-none, + attribute-defined-outside-init, + bad-except-order, + bad-format-character, + bad-format-string-key, + bad-format-string, + bad-open-mode, + bad-reversed-sequence, + bad-staticmethod-argument, + bad-str-strip-call, + bad-super-call, + binary-op-exception, + boolean-datetime, + catching-non-exception, + cell-var-from-loop, + confusing-with-statement, + continue-in-finally, + cyclical-import, + dangerous-default-value, + dict-items-not-iterating, + dict-keys-not-iterating, + dict-values-not-iterating, + duplicate-argument-name, duplicate-bases, - non-iterator-returned, - unexpected-special-method-signature, - invalid-length-returned, + duplicate-except, + duplicate-key, + eq-without-hash, + exception-escape, + exception-message-attribute, + expression-not-assigned, + filter-builtin-not-iterating, + format-combined-specification, + format-needs-mapping, + function-redefined, + global-variable-undefined, import-error, - used-before-assignment, - undefined-variable, - undefined-all-variable, + import-self, + inconsistent-mro, + indexing-exception, + inherit-non-class, + init-is-generator, invalid-all-object, - no-name-in-module, - unbalance-tuple-unpacking, - unpacking-non-sequence, - bad-except-order, - raising-bad-type, - misplaced-bare-raise, - raising-non-exception, - nonimplemented-raised, - catching-non-exception, - slots-on-old-class, - super-on-old-class, - bad-super-call, - missing-super-argument, - no-member, - not-callable, - assignment-from-no-return, - no-value-for-parameter, - too-many-function-args, - unexpected-keyword-arg, - redundant-keyword-arg, + invalid-encoded-data, + invalid-format-index, + invalid-length-returned, invalid-sequence-index, invalid-slice-index, - assignment-from-none, - not-context-manager, + invalid-slots-object, + invalid-slots, + invalid-str-codec, invalid-unary-operand-type, - unsupported-binary-operation, - repeated-keyword, - not-an-iterable, - not-a-mapping, - unsupported-membership-test, - unsubscriptable-object, - logging-unsupported-format, - logging-too-many-args, logging-too-few-args, - bad-format-character, - truncated-format-string, - mixed-fomat-string, - format-needs-mapping, + logging-too-many-args, + logging-unsupported-format, + lost-exception, + map-builtin-not-iterating, + method-hidden, + misplaced-bare-raise, + misplaced-future, + missing-format-argument-key, + missing-format-attribute, missing-format-string-key, - too-many-format-args, - too-few-format-args, - bad-str-strip-call, + missing-super-argument, + mixed-fomat-string, model-unicode-not-callable, - super-method-not-called, + no-member, + no-method-argument, + no-name-in-module, + no-self-argument, + no-value-for-parameter, + non-iterator-returned, non-parent-method-called, - test-inherits-tests, - translation-of-non-string, - redefined-variable-type, - cyclical-import, - unreachable, - dangerous-default-value, + nonexistent-operator, + nonimplemented-raised, + nonstandard-exception, + not-a-mapping, + not-an-iterable, + not-callable, + not-context-manager, + not-in-loop, pointless-statement, pointless-string-statement, - expression-not-assigned, - duplicate-key, - confusing-with-statement, - using-constant-test, - lost-exception, - assert-on-tuple, - attribute-defined-outside-init, - bad-staticmethod-argument, - arguments-differ, - signature-differs, - abstract-method, - super-init-not-called, - relative-import, - import-self, - misplaced-future, - invalid-encoded-data, - global-variable-undefined, - redefined-outer-name, + property-on-old-class, + raising-bad-type, + raising-non-exception, + raising-string, + range-builtin-not-iterating, redefined-builtin, redefined-in-handler, + redefined-outer-name, + redefined-variable-type, + redundant-keyword-arg, + relative-import, + repeated-keyword, + return-arg-in-generator, + return-in-init, + return-outside-function, + signature-differs, + slots-on-old-class, + super-init-not-called, + super-method-not-called, + super-on-old-class, + syntax-error, + sys-max-int, + test-inherits-tests, + too-few-format-args, + too-many-format-args, + too-many-function-args, + translation-of-non-string, + truncated-format-string, + unbalance-tuple-unpacking, + undefined-all-variable, undefined-loop-variable, - cell-var-from-loop, - duplicate-except, - nonstandard-exception, - binary-op-exception, - property-on-old-class, - bad-format-string-key, - unused-format-string-key, - bad-format-string, - missing-format-argument-key, + undefined-variable, + unexpected-keyword-arg, + unexpected-special-method-signature, + unpacking-non-sequence, + unreachable, + unsubscriptable-object, + unsupported-binary-operation, + unsupported-membership-test, unused-format-string-argument, - format-combined-specification, - missing-format-attribute, - invalid-format-index, - anomalous-backslash-in-string, - anomalous-unicode-escape-in-string, - bad-open-mode, - boolean-datetime, - - fatal, + unused-format-string-key, + used-before-assignment, + using-constant-test, + yield-outside-function, + zip-builtin-not-iterating, + astroid-error, - parse-error, - method-check-failed, + django-not-available-placeholder, django-not-available, + fatal, + method-check-failed, + parse-error, raw-checker-failed, - django-not-available-placeholder, - + empty-docstring, invalid-characters-in-docstring, missing-docstring, wrong-spelling-in-comment, wrong-spelling-in-docstring, - + + unused-argument, unused-import, unused-variable, - unused-argument, - - exec-used, + eval-used, - + exec-used, + bad-classmethod-argument, bad-mcs-classmethod-argument, bad-mcs-method-argument, bad-whitespace, + bare-except, + broad-except, consider-iterating-dictionary, consider-using-enumerate, + global-at-module-level, + global-variable-not-assigned, literal-used-as-attribute, + logging-format-interpolation, + logging-not-lazy, + metaclass-assignment, + model-has-unicode, + model-missing-unicode, + model-no-explicit-unicode, multiple-imports, multiple-statements, + no-classmethod-decorator, + no-staticmethod-decorator, + old-raise-syntax, old-style-class, + protected-access, + redundant-unittest-assert, + reimported, + simplifiable-if-statement, simplifiable-range, singleton-comparison, superfluous-parens, unidiomatic-typecheck, - unneeded-not, - wrong-assert-type, - simplifiable-if-statement, - no-classmethod-decorator, - no-staticmethod-decorator, - unnecessary-pass, unnecessary-lambda, - useless-else-on-loop, + unnecessary-pass, unnecessary-semicolon, - reimported, - global-variable-not-assigned, - global-at-module-level, - bare-except, - broad-except, - logging-not-lazy, - redundant-unittest-assert, - model-missing-unicode, - model-has-unicode, - model-no-explicit-unicode, - protected-access, - - deprecated-module, + unneeded-not, + useless-else-on-loop, + wrong-assert-type, + deprecated-method, - + deprecated-module, + + too-many-boolean-expressions, too-many-nested-blocks, too-many-statements, - too-many-boolean-expressions, - + + wildcard-import, wrong-import-order, wrong-import-position, - wildcard-import, - + missing-final-newline, + mixed-indentation, mixed-line-endings, trailing-newlines, trailing-whitespace, unexpected-line-ending-format, - mixed-indentation, - + + bad-inline-option, bad-option-value, + deprecated-pragma, unrecognized-inline-option, useless-suppression, - bad-inline-option, - deprecated-pragma, -disable = + + cmp-method, + coerce-method, + delslice-method, + dict-iter-method, + dict-view-method, + div-method, + getslice-method, + hex-method, + idiv-method, + next-method-called, + next-method-defined, + nonzero-method, + oct-method, + rdiv-method, + setslice-method, + using-cmp-argument, +disable = bad-continuation, - invalid-name, - misplaced-comparison-constant, - file-ignored, bad-indentation, - lowercase-l-suffix, - unused-wildcard-import, + consider-using-f-string, + duplicate-code, + file-ignored, + fixme, global-statement, + invalid-name, + locally-disabled, + locally-enabled, + lowercase-l-suffix, + misplaced-comparison-constant, no-else-return, - django-not-configured, - + no-init, + no-self-use, + suppressed-message, + too-few-public-methods, + too-many-ancestors, + too-many-arguments, + too-many-branches, + too-many-instance-attributes, + too-many-lines, + too-many-locals, + too-many-public-methods, + too-many-return-statements, + ungrouped-imports, + unspecified-encoding, + unused-wildcard-import, + use-maxsplit-arg, + + feature-toggle-needs-doc, + illegal-waffle-usage, + apply-builtin, backtick, + bad-python3-import, basestring-builtin, buffer-builtin, cmp-builtin, - cmp-method, coerce-builtin, - coerce-method, - delslice-method, - dict-iter-method, - dict-view-method, - duplicate-code, + deprecated-itertools-function, + deprecated-operator-function, + deprecated-str-translate-call, + deprecated-string-function, + deprecated-sys-function, + deprecated-types-field, + deprecated-urllib-function, execfile-builtin, - feature-toggle-needs-doc, file-builtin, - filter-builtin-not-iterating, - fixme, - getslice-method, - hex-method, - illegal-waffle-usage, import-star-module-level, - indexing-exception, input-builtin, intern-builtin, - locally-disabled, - locally-enabled, - logging-format-interpolation, long-builtin, long-suffix, - map-builtin-not-iterating, - metaclass-assignment, - next-method-called, no-absolute-import, - no-init, - no-self-use, - nonzero-method, - oct-method, + non-ascii-bytes-literal, old-division, old-ne-operator, old-octal-literal, - old-raise-syntax, parameter-unpacking, print-statement, - raising-string, - range-builtin-not-iterating, raw_input-builtin, reduce-builtin, reload-builtin, round-builtin, - setslice-method, standarderror-builtin, - suppressed-message, - too-few-public-methods, - too-many-ancestors, - too-many-arguments, - too-many-branches, - too-many-instance-attributes, - too-many-lines, - too-many-locals, - too-many-public-methods, - too-many-return-statements, - ungrouped-imports, unichr-builtin, unicode-builtin, unpacking-in-except, - using-cmp-argument, xrange-builtin, - zip-builtin-not-iterating, + + logging-fstring-interpolation, + django-not-configured, [REPORTS] output-format = text @@ -404,7 +431,7 @@ ignore-imports = no ignore-mixin-members = yes ignored-classes = SQLObject unsafe-load-any-extension = yes -generated-members = +generated-members = REQUEST, acl_users, aq_parent, @@ -430,7 +457,7 @@ generated-members = [VARIABLES] init-import = no dummy-variables-rgx = _|dummy|unused|.*_unused -additional-builtins = +additional-builtins = [CLASSES] defining-attr-methods = __init__,__new__,setUp @@ -451,11 +478,11 @@ max-public-methods = 20 [IMPORTS] deprecated-modules = regsub,TERMIOS,Bastion,rexec -import-graph = -ext-import-graph = -int-import-graph = +import-graph = +ext-import-graph = +int-import-graph = [EXCEPTIONS] overgeneral-exceptions = Exception -# 42226da5ce66bbfda9d557aac3602fd7a381f747 +# 5a38c87bd42739189f3eb650ceb9279968f62bcc diff --git a/pylintrc_tweaks b/pylintrc_tweaks new file mode 100644 index 0000000000000000000000000000000000000000..0dc70695c3b49373ba09c4a71ee27b5f0ffe8ece --- /dev/null +++ b/pylintrc_tweaks @@ -0,0 +1,3 @@ +[MESSAGES CONTROL] +disable+= + django-not-configured,