Advertisement
__chicao

tox.ini test for flake8

Feb 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # content of: tox.ini , put in same dir as setup.py
  2. [tox]
  3. envlist = py27
  4. [testenv]
  5. #deps= -r requirements.txt       # install pytest in the venvs
  6. usedevelop=True
  7. skipsdist=True
  8. changedir = tests
  9. deps = discover
  10.        unittest2
  11. commands = unit2 discover
  12.  
  13. [flake8]
  14. # http://flake8.pycqa.org/en/latest/user/error-codes.html
  15. # https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
  16. # http://flake8.pycqa.org/en/latest/user/options.html
  17. max-complexity=90
  18. max-line-length=120
  19. verbose=2
  20.  
  21. # Code complexity analysis using Radon.
  22. # To disable warnings regarding these tools, comment the lines below
  23. # http://radon.readthedocs.io/en/latest/flake8.html
  24. # http://radon.readthedocs.io/en/latest/intro.html
  25. radon-no-assert=True
  26. radon-max-cc=90
  27. radon-show-closures=True
  28.  
  29. # Configuration of errors and warnings printed in the output
  30. ignore =
  31.     #
  32.     # NOTE (*)
  33.     # In the default configuration, the checks E121, E123, E126, E133, E226,
  34.     # E241, E242, E704, W503 and W504 are ignored because they are not rules
  35.     # unanimously accepted, and PEP 8 does not enforce them. The check W503
  36.     # is mutually exclusive with check W504. The check E133 is mutually exclusive
  37.     # with check E123. Use switch --hang-closing to report E133 instead of E123.
  38.     #
  39.     # NOTE (^)
  40.     # These checks can be disabled at the line level using the # noqa special comment,
  41.     # in the python code This possibility should be reserved for special cases.
  42.  
  43.     #
  44.     #   E1 - Indentation
  45.     #
  46.     # indentation contains mixed spaces and tabs
  47.     # E101,
  48.     # indentation is not a multiple of four
  49.     # E111,
  50.     # expected an indented block
  51.     # E112,
  52.     # unexpected indentation
  53.     # E113,
  54.     # indentation is not a multiple of four (comment)
  55.     # E114,
  56.     # expected an indented block (comment)
  57.     # E115,
  58.     # unexpected indentation (comment)
  59.     # E116,
  60.     # (*^) - continuation line under-indented for hanging indent
  61.     # E121,
  62.     # (^) - continuation line missing indentation or outdented
  63.     # E122,
  64.     # (*) - closing bracket does not match indentation of opening bracket’s line
  65.     # E123,
  66.     # (^) - closing bracket does not match visual indentation
  67.     # E124,
  68.     # (^) - continuation line with same indent as next logical line
  69.     # E125,
  70.     # (*^) - continuation line over-indented for hanging indent
  71.     # E126,
  72.     # (^) - continuation line over-indented for visual indent
  73.     # E127 ,
  74.     # (^) - continuation line under-indented for visual indent
  75.     # E128,
  76.     # (^) - visually indented line with same indent as next logical line
  77.     # E129,
  78.     # (^) - continuation line unaligned for hanging indent
  79.     # E131,
  80.     # (*) - closing bracket is missing indentation
  81.     # E133,
  82.  
  83.     #
  84.     # E2 - Whitespace
  85.     #
  86.     # whitespace after ‘(
  87.     # E201,
  88.     # whitespace before ‘)
  89.     # E202,
  90.     # whitespace before ‘:’
  91.     # E203,
  92.     # whitespace before ‘(
  93.     # E211,
  94.     # multiple spaces before operator
  95.     # E221,
  96.     # multiple spaces after operator
  97.     # E222,
  98.     # tab before operator
  99.     # E223,
  100.     # tab after operator
  101.     # E224,
  102.     # missing whitespace around operator
  103.     # E225,
  104.     # (*) - missing whitespace around arithmetic operator
  105.     # E226,
  106.     # missing whitespace around bitwise or shift operator
  107.     # E227,
  108.     # missing whitespace around modulo operator
  109.     # E228,
  110.     # missing whitespace after ‘,’, ‘;’, or ‘:’
  111.     # E231,
  112.     # (*) - multiple spaces after ‘,’
  113.     # E241,
  114.     # (*) - tab after ‘,’
  115.     # E242,
  116.     # unexpected spaces around keyword / parameter equals
  117.     # E251,
  118.     # at least two spaces before inline comment
  119.     # E261,
  120.     # inline comment should start with ‘# ‘
  121.     # E262,
  122.     # block comment should start with ‘# ‘
  123.     # E265,
  124.     # too many leading ‘#’ for block comment
  125.     # E266,
  126.     # multiple spaces after keyword
  127.     # E271,
  128.     # multiple spaces before keyword
  129.     # E272,
  130.     # tab after keyword
  131.     # E273,
  132.     # tab before keyword
  133.     # E274,
  134.     # missing whitespace after keyword
  135.     # E275,
  136.  
  137.     #
  138.     # E3 - Blank line
  139.     #
  140.     # expected 1 blank line, found 0
  141.     # E301,
  142.     # expected 2 blank lines, found 0
  143.     # E302,
  144.     # too many blank lines (3)
  145.     # E303,
  146.     # blank lines found after function decorator
  147.     # E304,
  148.     # expected 2 blank lines after end of function or class
  149.     # E305,
  150.     # expected 1 blank line before a nested definition
  151.     # E306,
  152.  
  153.     #
  154.     # E4 - Import
  155.     #
  156.     # multiple imports on one line
  157.     # E401,
  158.     # module level import not at top of file
  159.     # E402,
  160.  
  161.     #
  162.     #   E5 - Line length
  163.     #
  164.     # (^) - line too long (82 > 79 characters)
  165.     # E501,
  166.     # the backslash is redundant between brackets
  167.     # E502,
  168.  
  169.     #
  170.     #   E7 - Statement
  171.     #
  172.     # multiple statements on one line (colon)
  173.     # E701,
  174.     # multiple statements on one line (semicolon)
  175.     # E702,
  176.     # statement ends with a semicolon
  177.     # E703,
  178.     # (*) - multiple statements on one line (def)
  179.     # E704,
  180.     # (^) - comparison to None should be ‘if cond is None:’
  181.     # E711,
  182.     # (^) - comparison to True should be ‘if cond is True:’ or ‘if cond:’
  183.     # E712,
  184.     # test for membership should be ‘not in’
  185.     # E713,
  186.     # test for object identity should be ‘is not’
  187.     # E714,
  188.     # (^) - do not compare types, use ‘isinstance()
  189.     # E721,
  190.     # do not use bare except, specify exception instead
  191.     # E722,
  192.     # do not assign a lambda expression, use a def
  193.     # E731,
  194.     # do not use variables named ‘l’, ‘O’, or ‘I’
  195.     # E741,
  196.     # do not define classes named ‘l’, ‘O’, or ‘I’
  197.     # E742,
  198.     # do not define functions named ‘l’, ‘O’, or ‘I’
  199.     # E743,
  200.  
  201.     #
  202.     #   E9 - Runtime
  203.     #
  204.     # SyntaxError or IndentationError
  205.     # E901,
  206.     # IOError
  207.     # E902,
  208.  
  209.     #
  210.     #   W - Indentation, whitespace, blank lines, breaks and deprecation warnings
  211.     #
  212.     #
  213.     # indentation contains tabs
  214.     # W191,
  215.     # trailing whitespace
  216.     # W291,
  217.     # no newline at end of file
  218.     # W292,
  219.     # blank line contains whitespace
  220.     # W293,
  221.     # blank line at end of file
  222.     # W391,
  223.     # (*) - line break before binary operator
  224.     # W503,
  225.     # (*) - line break after binary operator
  226.     # W504,
  227.     # .has_key() is deprecated, use ‘in’
  228.     # W601,
  229.     # deprecated form of raising exception
  230.     # W602,
  231.     # ‘<>’ is deprecated, use ‘!=
  232.     # W603,
  233.     # backticks are deprecated, use ‘repr()
  234.     # W604,
  235.     # invalid escape sequence ‘x’
  236.     # W605,
  237.  
  238.     #
  239.     # ERRORS and VIOLATION CODES. Add a comment in the line to enable its verification
  240.     # module imported but unused
  241.     # F401,
  242.     # import module from line N shadowed by loop variable
  243.     # F402,
  244.     # ‘from module import *’ used; unable to detect undefined names
  245.     # F403,
  246.     # future import(s) name after other statements
  247.     # F404,
  248.     # name may be undefined, or defined from star imports: module
  249.     # F405,
  250.     # ‘from module import *’ only allowed at module level
  251.     # F406,
  252.     # an undefined __future__ feature name was imported
  253.     # F407,
  254.     # dictionary key name repeated with different values
  255.     # F601,
  256.     # dictionary key variable name repeated with different values
  257.     # F602,
  258.     # too many expressions in an assignment with star-unpacking
  259.     # F621,
  260.     # two or more starred expressions in an assignment (a, *b, *c = d)
  261.     # F622,
  262.     # assertion test is a tuple, which are always True
  263.     # F631,
  264.     # a break statement outside of a while or for loop
  265.     # F701,
  266.     # a continue statement outside of a while or for loop
  267.     # F702,
  268.     # a continue statement in a finally block in a loop
  269.     # F703,
  270.     # a yield or yield from statement outside of a function
  271.     # F704,
  272.     # a return statement with arguments inside a generator
  273.     # F705,
  274.     # a return statement outside of a function/method
  275.     # F706,
  276.     # an except: block as not the last exception handler
  277.     # F707,
  278.     # redefinition of unused <name> from line <N>
  279.     # F811,
  280.     # list comprehension redefines <name> from line <N>
  281.     # F812,
  282.     # undefined name name
  283.     # F821,
  284.     # undefined name name in __all__
  285.     # F822,
  286.     # local variable name … referenced before assignment
  287.     # F823,
  288.     # duplicate argument name in function definition
  289.     # F831,
  290.     # local variable name is assigned to but never used
  291.     # F841,
  292.  
  293. #
  294. # Exclude dirs from verification
  295. #
  296. exclude =
  297.         .hg,
  298.         __pycache__,
  299.         old,
  300.         build,
  301.         dist,
  302.         static,
  303.         .Python
  304.         build,
  305.         develop-eggs,
  306.         downloads,
  307.         eggs,
  308.         .eggs,
  309.         lib,
  310.         lib64,
  311.         parts,
  312.         sdist,
  313.         var,
  314.         wheels,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement