Skip to content

Missing Google Style Guide Rules #36

@cfournie

Description

@cfournie

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions