Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Merge requests
  • !1110

Normalize build files using Bazel's build file formatter (buildifier).

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge buildifier into master Jan 12, 2017
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 169

Created by: bolinfest

I created a small fork of https://github.com/bazelbuild/buildifier at https://github.com/bolinfest/buildifier/tree/buck. The notable changes are:

  • Use single quotes instead of double quotes.
  • Use 2-space indents instead of 4-space indents.

I built my fork as per the instructions:

bazel build //buildifier

I copied the output to my local Buck repo:

cp ~/code/buildifier/bazel-bin/buildifier/buildifier buildifier

And then I ran it on Buck itself:

./buildifier -showlog -mode=fix -buildifier_disable=label $(find . -name BUCK -type f)

The results of running buildifier can be seen in this commit.

Note that it emitted two warnings when I ran it:

./test/com/facebook/buck/apple/BUCK:1:28: syntax error near :
./src/com/facebook/buck/apple/BUCK:1:28: syntax error near :

I believe this has to do with our unconventional use of with in those build files:

with allow_unsafe_import():
    from sys import platform as os_platform
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: buildifier