.pylintrc-tests 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. [MASTER]
  2. ignore=
  3. src/python/grpcio_tests/tests/unit/beta,
  4. src/python/grpcio_tests/tests/unit/framework,
  5. src/python/grpcio_tests/tests/unit/framework/common,
  6. src/python/grpcio_tests/tests/unit/framework/foundation,
  7. [VARIABLES]
  8. # TODO(https://github.com/PyCQA/pylint/issues/1345): How does the inspection
  9. # not include "unused_" and "ignored_" by default?
  10. dummy-variables-rgx=^ignored_|^unused_
  11. [DESIGN]
  12. # NOTE(nathaniel): Not particularly attached to this value; it just seems to
  13. # be what works for us at the moment (excepting the dead-code-walking Beta
  14. # API).
  15. max-args=6
  16. [MISCELLANEOUS]
  17. # NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and
  18. # "NOTE(<username or issue link>): ". We do not allow "TODO:",
  19. # "TODO(<username>):", "FIXME:", or anything else.
  20. notes=FIXME,XXX
  21. [MESSAGES CONTROL]
  22. extension-pkg-whitelist=grpc._cython.cygrpc
  23. disable=
  24. # These suppressions are specific to tests:
  25. #
  26. # TODO(https://github.com/grpc/grpc/issues/261): investigate
  27. # each of the following one by one and consider eliminating
  28. # the suppression category.
  29. # Eventually, the hope is to eliminate the .pylintrc-tests
  30. # altogether and rely on .pylintrc for everything.
  31. pointless-statement,
  32. no-member,
  33. no-self-use,
  34. attribute-defined-outside-init,
  35. unused-argument,
  36. unused-variable,
  37. unused-import,
  38. redefined-builtin,
  39. too-many-public-methods,
  40. too-many-locals,
  41. redefined-variable-type,
  42. redefined-outer-name,
  43. ungrouped-imports,
  44. too-many-branches,
  45. too-many-arguments,
  46. too-many-format-args,
  47. too-many-return-statements,
  48. too-many-statements,
  49. line-too-long,
  50. wrong-import-position,
  51. wrong-import-order,
  52. # -- END OF TEST-SPECIFIC SUPPRESSIONS --
  53. # TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279):
  54. # Enable cyclic-import after a 1.7-or-later pylint release that
  55. # recognizes our disable=cyclic-import suppressions.
  56. cyclic-import,
  57. # TODO(https://github.com/grpc/grpc/issues/8622): Enable this after the
  58. # Beta API is removed.
  59. duplicate-code,
  60. # TODO(https://github.com/grpc/grpc/issues/261): Doesn't seem to
  61. # understand enum and concurrent.futures; look into this later with the
  62. # latest pylint version.
  63. import-error,
  64. # TODO(https://github.com/grpc/grpc/issues/261): Enable this one.
  65. # Should take a little configuration but not much.
  66. invalid-name,
  67. # TODO(https://github.com/grpc/grpc/issues/261): This doesn't seem to
  68. # work for now? Try with a later pylint?
  69. locally-disabled,
  70. # NOTE(nathaniel): What even is this? *Enabling* an inspection results
  71. # in a warning? How does that encourage more analysis and coverage?
  72. locally-enabled,
  73. # NOTE(nathaniel): We don't write doc strings for most private code
  74. # elements.
  75. missing-docstring,
  76. # NOTE(nathaniel): In numeric comparisons it is better to have the
  77. # lesser (or lesser-or-equal-to) quantity on the left when the
  78. # expression is true than it is to worry about which is an identifier
  79. # and which a literal value.
  80. misplaced-comparison-constant,
  81. # NOTE(nathaniel): Our completely abstract interface classes don't have
  82. # constructors.
  83. no-init,
  84. # TODO(https://github.com/grpc/grpc/issues/261): Doesn't yet play
  85. # nicely with some of our code being implemented in Cython. Maybe in a
  86. # later version?
  87. no-name-in-module,
  88. # TODO(https://github.com/grpc/grpc/issues/261): Suppress these where
  89. # the odd shape of the authentication portion of the API forces them on
  90. # us and enable everywhere else.
  91. protected-access,
  92. # NOTE(nathaniel): Pylint and I will probably never agree on this.
  93. too-few-public-methods,
  94. # NOTE(nathaniel): Pylint and I wil probably never agree on this for
  95. # private classes. For public classes maybe?
  96. too-many-instance-attributes,
  97. # NOTE(nathaniel): Some of our modules have a lot of lines... of
  98. # specification and documentation. Maybe if this were
  99. # lines-of-code-based we would use it.
  100. too-many-lines,
  101. # TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
  102. # this one if we extracted just a few more helper functions...
  103. too-many-nested-blocks,
  104. # TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
  105. # super-init requirement for abstract class implementations for now.
  106. super-init-not-called,
  107. # NOTE(nathaniel): A single statement that always returns program
  108. # control is better than two statements the first of which sometimes
  109. # returns program control and the second of which always returns
  110. # program control. Probably generally, but definitely in the cases of
  111. # if:/else: and for:/else:.
  112. useless-else-on-loop,
  113. no-else-return,
  114. # NOTE(lidiz): Python 3 make object inheritance default, but not PY2
  115. useless-object-inheritance,
  116. # NOTE(lidiz): the import order will be enforced by isort instead
  117. wrong-import-order,
  118. # NOTE(sergiitk): yapf compatibility, ref #25071
  119. bad-continuation,