Skip to content

incompatible_strict_argument_ordering #6611

Closed
@laurentlb

Description

Based on the discussion on bazelbuild/starlark#13, we're going to make argument ordering stricter. It also makes the semantics simpler to understand, and can simplify tooling.

All arguments should be in this order:

  • First, positional arguments
  • Then, keyword arguments
  • Then, an optional *arg
  • Finally, an optional **kwarg

e.g. f(a, b, c = 1, d = 2, *e, **f)

Migration: update buildifier to automatically fix the call sites.
It is also trivial to fix manually: change the order of the arguments.

- f(a, b, *c, d = 2)
+ f(a, b, d = 2, *c)

Expected timeline:

  • released with Bazel 0.21 (December 2018), off by default
  • enabled by default with Bazel 0.23 (February 2019)

Metadata

Assignees

No one assigned

    Labels

    P1I'll work on this now. (Assignee required)incompatible-changeIncompatible/breaking change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions