[MASTER]

# Specify a configuration file.
#rcfile=

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=

# Pickle collected data for later comparisons.
persistent=yes

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=edx_lint.pylint,pylint_django,pylint_celery


[MESSAGES CONTROL]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
enable=
    # These are controlled by explicit choices in the pylintrc files
    blacklisted-name,
    line-too-long,

    # These affect the correctness of the code
    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,
    access-member-before-definition,
    no-method-argument,
    no-self-argument,
    invalid-slots-object,
    assigning-non-slot,
    invalid-slots,
    inherit-non-class,
    inconsistent-mro,
    duplicate-bases,
    non-iterator-returned,
    unexpected-special-method-signature,
    invalid-length-returned,
    import-error,
    used-before-assignment,
    undefined-variable,
    undefined-all-variable,
    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-sequence-index,
    invalid-slice-index,
    assignment-from-none,
    not-context-manager,
    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,
    missing-format-string-key,
    too-many-format-args,
    too-few-format-args,
    bad-str-strip-call,
    model-unicode-not-callable,
    super-method-not-called,
    non-parent-method-called,
    test-inherits-tests,
    translation-of-non-string,
    redefined-variable-type,
    cyclical-import,
    unreachable,
    dangerous-default-value,
    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,
    redefined-builtin,
    redefined-in-handler,
    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,
    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,

    # Checking failed for some reason
    fatal,
    astroid-error,
    parse-error,
    method-check-failed,
    django-not-available,
    raw-checker-failed,
    django-not-available-placeholder,

    # Documentation is important
    empty-docstring,
    invalid-characters-in-docstring,
    missing-docstring,
    wrong-spelling-in-comment,
    wrong-spelling-in-docstring,

    # Unused code should be deleted
    unused-import,
    unused-variable,
    unused-argument,

    # These are dangerous!
    exec-used,
    eval-used,

    # These represent idiomatic python. Not adhering to them
    # will raise red flags with future readers.
    bad-classmethod-argument,
    bad-mcs-classmethod-argument,
    bad-mcs-method-argument,
    bad-whitespace,
    consider-iterating-dictionary,
    consider-using-enumerate,
    literal-used-as-attribute,
    multiple-imports,
    multiple-statements,
    old-style-class,
    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-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,

    # Don't use things that are deprecated
    deprecated-module,
    deprecated-method,

    # These help manage code complexity
    too-many-nested-blocks,
    too-many-statements,
    too-many-boolean-expressions,

    # Consistent import order makes finding where code is
    # imported from easier
    ungrouped-imports,
    wrong-import-order,
    wrong-import-position,
    wildcard-import,

    # These should be auto-fixed by any competent editor
    missing-final-newline,
    mixed-line-endings,
    trailing-newlines,
    trailing-whitespace,
    unexpected-line-ending-format,
    mixed-indentation,

    # These attempt to limit pylint line-noise
    bad-option-value,
    unrecognized-inline-option,
    useless-suppression,
    bad-inline-option,
    deprecated-pragma,

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=
    # These should be left to the discretion of the reviewer
    bad-continuation,
    invalid-name,
    misplaced-comparison-constant,
    file-ignored,
    bad-indentation,
    lowercase-l-suffix,
    unused-wildcard-import,
    global-statement,
    no-else-return,

    # These are disabled by pylint by default
    apply-builtin,
    backtick,
    basestring-builtin,
    buffer-builtin,
    cmp-builtin,
    cmp-method,
    coerce-builtin,
    coerce-method,
    delslice-method,
    dict-iter-method,
    dict-view-method,
    duplicate-code,
    execfile-builtin,
    file-builtin,
    filter-builtin-not-iterating,
    fixme,
    getslice-method,
    hex-method,
    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,
    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,
    unichr-builtin,
    unicode-builtin,
    unpacking-in-except,
    using-cmp-argument,
    xrange-builtin,
    zip-builtin-not-iterating,



[REPORTS]

# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=no

# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)


# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=


[BASIC]

# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input

# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$

# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Regular expression which should only match correct function names
# Normally limited to 30 chars, but test names can be as long as they want
function-rgx=([a-z_][a-z0-9_]{2,40}|test_[a-z0-9_]+)$

# Regular expression which should only match correct method names
# Normally, should be all lower, but some exceptions for unittest methods
method-rgx=([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$

# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Good variable names which should always be accepted, separated by a comma
good-names=f,i,j,k,db,ex,Run,_,__

# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=__.*__$|test_.+|setUp$|setUpClass$|tearDown$|tearDownClass$|Meta$

# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=5


[FORMAT]

# Maximum number of characters on a single line.
max-line-length=120

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$

# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string='    '


[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO


[SIMILARITIES]

# Minimum lines number of a similarity.
min-similarity-lines=4

# Ignore comments when computing similarities.
ignore-comments=yes

# Ignore docstrings when computing similarities.
ignore-docstrings=yes

# Ignore imports when computing similarities.
ignore-imports=no


[TYPECHECK]

# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes

# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject

# C Extension modules must be imported to be inspected.  For security reasons,
# this # is not done by default, but we expect all imported code to be run at
# some point anyway, so we explicitly allow it here
unsafe-load-any-extension=yes

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=
    REQUEST,
    acl_users,
    aq_parent,
    objects,
    DoesNotExist,
    can_read,
    can_write,
    get_url,
    size,
    content,
    status_code,
# For factory_boy factories
    create,
    build,
# For xblocks
    fields,
# For locations
    tag,
    org,
    course,
    category,
    name,
    revision,
# For django models
    _meta,


[VARIABLES]

# Tells whether we should check for unused import in __init__ files.
init-import=no

# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_|dummy|unused|.*_unused

# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=


[CLASSES]

# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp

# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls

# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs


[DESIGN]

# Maximum number of arguments for function / method
max-args=5

# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*

# Maximum number of locals for function / method body
max-locals=15

# Maximum number of return / yield for function / method body
max-returns=6

# Maximum number of branch for function / method body
max-branches=12

# Maximum number of statements in function / method body
max-statements=50

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of attributes for a class (see R0902).
max-attributes=7

# Minimum number of public methods for a class (see R0903).
min-public-methods=2

# Maximum number of public methods for a class (see R0904).
max-public-methods=20


[IMPORTS]

# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec

# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=

# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=

# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=


[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
