.pylintrc-examples 4.0 KB

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