New issue
Advanced search Search tips

Issue 625576 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

gn format doesn't infer custom variable type

Reported by ingem...@opera.com, Jul 4 2016

Issue description

Version (gn): 403392

What steps will reproduce the problem?
gn format --stdin <<EOF
action("test") {
  sources = [ "somewhat/long/path/to/src/org/chromium/components/test/JavaClass.java" ]

  custom_variable = [ "somewhat/long/path/to/src/org/chromium/components/test/JavaClass.java" ]
}
EOF


What is the expected output?
action("test") {
  sources = [
    "somewhat/long/path/to/src/org/chromium/components/test/JavaClass.java",
  ]

  custom_variable = [
    "somewhat/long/path/to/src/org/chromium/components/test/JavaClass.java",
  ]
}


What do you see instead?
action("test") {
  sources = [
    "somewhat/long/path/to/src/org/chromium/components/test/JavaClass.java",
  ]

  custom_variable =
      [ "somewhat/long/path/to/src/org/chromium/components/test/JavaClass.java" ]
}


Discussed in https://codereview.chromium.org/2110543004/. gn format (and thus git cl format) seems to assume any "custom" variable is of a non-list type. This means list declarations like "java_files" is formatted differently than "sources", even when they both are lists.
 

Comment 1 by ingem...@opera.com, Jul 4 2016

Cc: dpranke@chromium.org
Similar to https://bugs.chromium.org/p/chromium/issues/detail?id=551558.

Sign in to add a comment