Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Google Style Guide Rules #36

Open
5 of 13 tasks
cfournie opened this issue Mar 13, 2017 · 0 comments
Open
5 of 13 tasks

Missing Google Style Guide Rules #36

cfournie opened this issue Mar 13, 2017 · 0 comments

Comments

@cfournie
Copy link
Contributor

cfournie commented Mar 13, 2017

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

  • Use simple generators (list comprehensions in-progress Restrict list comprehension complexity #30; limit complexity) [link]
  • Use default iterators and operators for types that support them, like lists, dictionaries, and files [link].
  • 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]
  • Conditional Expressions (limit complexity) [link]
  • Use the "implicit" false if at all possible. [link]
  • 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]
  • 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]
  • Imports should be on separate lines. (in-progress add new check for multiple imports #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]
This was referenced Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant