.pylintrc 3.9 KB

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