.pylintrc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Copyright (c) 2019 Ultimaker B.V.
  2. # This file contains the Pylint rules used in the stardust projects.
  3. # To configure PyLint as an external tool in PyCharm, create a new External Tool with the settings:
  4. #
  5. # Name: PyLint
  6. # Program: Check with 'which pylint'. For example: ~/.local/bin/pylint
  7. # Arguments: $FileDirName$ --rcfile=.pylintrc --msg-template='{abspath}:{line}:{column}:({symbol}):{msg_id}:{msg}'
  8. # Working directory: $ContentRoot$
  9. # Output filters: $FILE_PATH$:$LINE$:$COLUMN$:.*
  10. #
  11. # You can add a keyboard shortcut in the keymap settings. To run Pylint to a project, select the module
  12. # you want to check (e.g. cura folder) before running the external tool.
  13. #
  14. # If you find a better way to configure the external tool please edit this file.
  15. [MASTER]
  16. # List of plugins (as comma separated values of python modules names) to load,
  17. # usually to register additional checkers.
  18. load-plugins=pylint_quotes
  19. # We expect double string quotes
  20. string-quote=double-avoid-escape
  21. # When enabled, pylint would attempt to guess common misconfiguration and emit
  22. # user-friendly hints instead of false-positive error messages.
  23. suggestion-mode=yes
  24. # Add files or directories to the blacklist. They should be base names, not paths.
  25. ignore=tests
  26. [REFACTORING]
  27. # Maximum number of nested blocks for function / method body
  28. max-nested-blocks=5
  29. [MESSAGES CONTROL]
  30. # C0326: No space allowed around keyword argument assignment
  31. # C0411: Ignore import order because the rules are different than in PyCharm, so automatic imports break lots of builds
  32. # C0412: Ignore import order because the rules are different than in PyCharm, so automatic imports break lots of builds
  33. # C0413: Ignore import order because the rules are different than in PyCharm, so automatic imports break lots of builds
  34. # R0201: Method could be a function (no-self-use)
  35. # R0401: Cyclic imports (cyclic-import) are used for typing
  36. # R0801: Unfortunately the error is triggered for a lot of similar models (duplicate-code)
  37. # R1710: Either all return statements in a function should return an expression, or none of them should.
  38. # W0221: Parameters differ from overridden method (tornado http methods have a flexible number of parameters)
  39. # W0511: Ignore warnings generated for TODOs in the code
  40. # C0111: We don't use docstring
  41. # C0303: Trailing whitespace isn't something we care about
  42. # C4001: You can put " in a string if you escape it first...
  43. disable=C0326,C0411,C0412,C0413,R0201,R0401,R0801,R1710,W0221,W0511, C0111, C0303,C4001
  44. [FORMAT]
  45. # Maximum number of characters on a single line.
  46. max-line-length=120
  47. # Maximum number of lines in a module.
  48. max-module-lines=500
  49. good-names=os
  50. [BASIC]
  51. # allow modules and functions to use PascalCase
  52. module-rgx=[a-zA-Z0-9_]+$
  53. function-rgx=
  54. ## Allowed methods:
  55. # getSomething
  56. # _getSomething
  57. # __getSomething
  58. # __new__
  59. ## Disallowed:
  60. # _GET
  61. # GetSomething
  62. method-rgx=(_{,2}[a-z][A-Za-z0-9]*_{,2})$
  63. [DESIGN]
  64. # Maximum number of arguments for function / method.
  65. max-args=7
  66. # Maximum number of attributes for a class (see R0902).
  67. max-attributes=8
  68. # Maximum number of boolean expressions in an if statement.
  69. max-bool-expr=5
  70. # Maximum number of branch for function / method body.
  71. max-branches=12
  72. # Maximum number of locals for function / method body.
  73. max-locals=15
  74. # Maximum number of parents for a class (see R0901).
  75. max-parents=7
  76. # Maximum number of public methods for a class (see R0904).
  77. max-public-methods=20
  78. # Maximum number of return / yield for function / method body.
  79. max-returns=6
  80. # Maximum number of statements in function / method body.
  81. max-statements=50
  82. # Minimum number of public methods for a class (R0903).
  83. # We set this to 0 because our models and fields do not have methods.
  84. min-public-methods=0
  85. ignored-argument-names=arg|args|kwargs|_
  86. [CLASSES]
  87. defining-attr-methods=__init__,__new__,setUp,initialize
  88. [TYPECHECK]
  89. ignored-classes=NotImplemented
  90. [VARIABLES]
  91. dummy-variables-rgx=_+[a-z0-9_]{2,30}