.flake8 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. [flake8]
  2. select =
  3. # Full lists are given in order to suppress all errors from other plugins
  4. # Full list of pyflakes error codes:
  5. F401, # module imported but unused
  6. F402, # import module from line N shadowed by loop variable
  7. F403, # 'from module import *' used; unable to detect undefined names
  8. F404, # future import(s) name after other statements
  9. F405, # name may be undefined, or defined from star imports: module
  10. F406, # 'from module import *' only allowed at module level
  11. F407, # an undefined __future__ feature name was imported
  12. F601, # dictionary key name repeated with different values
  13. F602, # dictionary key variable name repeated with different values
  14. F621, # too many expressions in an assignment with star-unpacking
  15. F622, # two or more starred expressions in an assignment (a, *b, *c = d)
  16. F631, # assertion test is a tuple, which are always True
  17. F701, # a break statement outside of a while or for loop
  18. F702, # a continue statement outside of a while or for loop
  19. F703, # a continue statement in a finally block in a loop
  20. F704, # a yield or yield from statement outside of a function
  21. F705, # a return statement with arguments inside a generator
  22. F706, # a return statement outside of a function/method
  23. F707, # an except: block as not the last exception handler
  24. F721, F722, # doctest syntax error syntax error in forward type annotation
  25. F811, # redefinition of unused name from line N
  26. F812, # list comprehension redefines name from line N
  27. F821, # undefined name name
  28. F822, # undefined name name in __all__
  29. F823, # local variable name referenced before assignment
  30. F831, # duplicate argument name in function definition
  31. F841, # local variable name is assigned to but never used
  32. F901, # raise NotImplemented should be raise NotImplementedError
  33. # Full list of pycodestyle violations:
  34. E101, # indentation contains mixed spaces and tabs
  35. E111, # indentation is not a multiple of four
  36. E112, # expected an indented block
  37. E113, # unexpected indentation
  38. E114, # indentation is not a multiple of four (comment)
  39. E115, # expected an indented block (comment)
  40. E116, # unexpected indentation (comment)
  41. E121, # continuation line under-indented for hanging indent
  42. E122, # continuation line missing indentation or outdented
  43. E123, # closing bracket does not match indentation of opening bracket's line
  44. E124, # closing bracket does not match visual indentation
  45. E125, # continuation line with same indent as next logical line
  46. E126, # continuation line over-indented for hanging indent
  47. E127, # continuation line over-indented for visual indent
  48. E128, # continuation line under-indented for visual indent
  49. E129, # visually indented line with same indent as next logical line
  50. E131, # continuation line unaligned for hanging indent
  51. E133, # closing bracket is missing indentation
  52. E201, # whitespace after '('
  53. E202, # whitespace before ')'
  54. E203, # whitespace before ':'
  55. E211, # whitespace before '('
  56. E221, # multiple spaces before operator
  57. E222, # multiple spaces after operator
  58. E223, # tab before operator
  59. E224, # tab after operator
  60. E225, # missing whitespace around operator
  61. E226, # missing whitespace around arithmetic operator
  62. E227, # missing whitespace around bitwise or shift operator
  63. E228, # missing whitespace around modulo operator
  64. E231, # missing whitespace after ',', ';', or ':'
  65. E241, # multiple spaces after ','
  66. E242, # tab after ','
  67. E251, # unexpected spaces around keyword / parameter equals
  68. E261, # at least two spaces before inline comment
  69. E262, # inline comment should start with '# '
  70. E265, # block comment should start with '# '
  71. E266, # too many leading '#' for block comment
  72. E271, # multiple spaces after keyword
  73. E272, # multiple spaces before keyword
  74. E273, # tab after keyword
  75. E274, # tab before keyword
  76. E275, # missing whitespace after keyword
  77. E301, # expected 1 blank line, found 0
  78. E302, # expected 2 blank lines, found 0
  79. E303, # too many blank lines
  80. E304, # blank lines found after function decorator
  81. E305, # expected 2 blank lines after end of function or class
  82. E306, # expected 1 blank line before a nested definition
  83. E401, # multiple imports on one line
  84. E402, # module level import not at top of file
  85. E501, # line too long (82 > 79 characters)
  86. E502, # the backslash is redundant between brackets
  87. E701, # multiple statements on one line (colon)
  88. E702, # multiple statements on one line (semicolon)
  89. E703, # statement ends with a semicolon
  90. E704, # multiple statements on one line (def)
  91. E711, # comparison to None should be 'if cond is None:'
  92. E712, # comparison to True should be 'if cond is True:' or 'if cond:'
  93. E713, # test for membership should be 'not in'
  94. E714, # test for object identity should be 'is not'
  95. E721, # do not compare types, use 'isinstance()'
  96. E722, # do not use bare except, specify exception instead
  97. E731, # do not assign a lambda expression, use a def
  98. E741, # do not use variables named 'l', 'O', or 'I'
  99. E742, # do not define classes named 'l', 'O', or 'I'
  100. E743, # do not define functions named 'l', 'O', or 'I'
  101. E901, # SyntaxError or IndentationError
  102. E902, # IOError
  103. W191, # indentation contains tabs
  104. W291, # trailing whitespace
  105. W292, # no newline at end of file
  106. W293, # blank line contains whitespace
  107. W391, # blank line at end of file
  108. W503, # line break before binary operator
  109. W504, # line break after binary operator
  110. W505, # doc line too long (82 > 79 characters)
  111. W601, # .has_key() is deprecated, use 'in'
  112. W602, # deprecated form of raising exception
  113. W603, # '<>' is deprecated, use '!='
  114. W604, # backticks are deprecated, use 'repr()'
  115. W605, # invalid escape sequence 'x'
  116. W606, # 'async' and 'await' are reserved keywords starting with Python 3.7
  117. # Full list of flake8 violations
  118. E999, # failed to compile a file into an Abstract Syntax Tree for the plugins that require it
  119. # Full list of mccabe violations
  120. C901 # complexity value provided by the user
  121. ignore =
  122. E221, # multiple spaces before operator
  123. E231, # missing whitespace after ',', ';', or ':'
  124. E241, # multiple spaces after ','
  125. W503, # line break before binary operator
  126. W504 # line break after binary operator
  127. max-line-length = 160
  128. show_source = True
  129. statistics = True
  130. exclude =
  131. .git,
  132. __pycache__,
  133. # submodules
  134. components/bootloader/subproject/components/micro-ecc/micro-ecc,
  135. components/bt/host/nimble/nimble,
  136. components/cmock/CMock,
  137. components/json/cJSON,
  138. components/mbedtls/mbedtls,
  139. components/openthread/openthread,
  140. components/tinyusb,
  141. components/unity/unity,
  142. components/spiffs/spiffs,
  143. # autogenerated scripts
  144. components/protocomm/python/constants_pb2.py,
  145. components/protocomm/python/sec0_pb2.py,
  146. components/protocomm/python/sec1_pb2.py,
  147. components/protocomm/python/sec2_pb2.py,
  148. components/protocomm/python/session_pb2.py,
  149. components/wifi_provisioning/python/wifi_scan_pb2.py,
  150. components/wifi_provisioning/python/wifi_config_pb2.py,
  151. components/wifi_provisioning/python/wifi_constants_pb2.py,
  152. components/esp_local_ctrl/python/esp_local_ctrl_pb2.py,
  153. per-file-ignores =
  154. # Sphinx conf.py files use star imports to setup config variables
  155. docs/conf_common.py: F405