Skip to content

Skylark style guide #63

@davidzchen

Description

@davidzchen

While Skylark is a Python subset, there are slight differences between Skylark/BUILD style vs. the Google Python conventions. For example (from the Skylark cookbook:

def macro(name, visibility=None):
  # Creating a native genrule.
  native.genrule(
      name = name,
      outs = [name + '.txt'],
      cmd = 'echo hello > $@',
      visibility = visibility,
  )

Rule invocations such as native.genrule() follow the BUILD style rather than the standard Python function call style.

I think it would be good to write a Skylark Style Guide that defines a convention for Skylark code and lists some best practices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions