buildifier: make formatting idempotent for compact block statements followed by comments (#1481)

* Make formatting idempotent for compact block statements followed by comments

Comments following a block statement (def/for/if) now parse as standalone CommentBlock statements, matching the expanded-form parse, so buildifier converges in a single pass. Fixes bazelbuild/buildtools#1470.

* Regenerate parse.y.go with goyacc (x/tools v0.15.0)

* Add regression testdata for #1470 (input)

* Add regression testdata for #1470 (golden)

Add golden file 078.golden with function definitions and comments.
4 files changed
tree: 355c1240d442a6fab29045d79876f78ed6ea35bc
  1. .bazelci/
  2. .github/
  3. api_proto/
  4. build/
  5. build_proto/
  6. buildifier/
  7. buildozer/
  8. bzlenv/
  9. config/
  10. convertast/
  11. deps_proto/
  12. differ/
  13. edit/
  14. extra_actions_base_proto/
  15. file/
  16. generatetables/
  17. labels/
  18. lang/
  19. release/
  20. tables/
  21. testutils/
  22. unused_deps/
  23. warn/
  24. wspace/
  25. .bazelrc
  26. .bazelversion
  27. .gitignore
  28. .mailmap
  29. .pre-commit-config.yaml
  30. BUILD.bazel
  31. CODEOWNERS
  32. CONTRIBUTING.md
  33. CONTRIBUTORS
  34. go.mod
  35. go.sum
  36. launcher.js
  37. LICENSE
  38. MODULE.bazel
  39. README.md
  40. status.py
  41. update_generated.sh
  42. WARNINGS.md
  43. WORKSPACE
  44. WORKSPACE.bzlmod
README.md

Buildtools for bazel

This repository contains developer tools for working with Google's bazel buildtool.

Build status

Setup

See instructions in each tool's directory.