shopify_python icon indicating copy to clipboard operation
shopify_python copied to clipboard

Missing Google Style Guide Rules

Open cfournie opened this issue 7 years ago • 0 comments

Missing Google Style Guide rules that are not already covered by pylint include:

  • [ ] Use simple generators (list comprehensions in-progress https://github.com/Shopify/shopify_python/pull/30; limit complexity) [link]
  • [ ] Use default iterators and operators for types that support them, like lists, dictionaries, and files [link].
  • [x] For common operations like multiplication, use the functions from the operator module instead of lambda functions. For example, prefer operator.mul to lambda x, y: x * y. [link]
  • [x] Conditional Expressions (limit complexity) [link]
  • [ ] Use the "implicit" false if at all possible. [link]
  • [x] Do not terminate your lines with semi-colons and do not use semi-colons to put two commands on the same line. [link]
  • [ ] Do not use backslash line continuation. [link]
  • [ ] Be sure to use the right style for module, function, method and in-line comments. (https://github.com/PyCQA/pydocstyle can be used to accomplish this) [link]
  • [x] If a class inherits from no other base classes, explicitly inherit from object. This also applies to nested classes. [link]
  • [ ] Use the format method or the % operator for formatting strings, even when the parameters are all strings. Use your best judgement to decide between + and % (or format) though. [link]
  • [x] Imports should be on separate lines. (in-progress https://github.com/Shopify/shopify_python/pull/24) [link]
  • [ ] Generally only one statement per line. [link]
  • [ ] Even a file meant to be used as a script should be importable and a mere import should not have the side effect of executing the script's main functionality. The main functionality should be in a main() function. [link]

cfournie avatar Mar 13 '17 18:03 cfournie