Skip to content

Permit configuration extensions#484

Draft
alexeagle wants to merge 1 commit intoaspect-build:mainfrom
b0inbot:poc/extensions_json
Draft

Permit configuration extensions#484
alexeagle wants to merge 1 commit intoaspect-build:mainfrom
b0inbot:poc/extensions_json

Conversation

@alexeagle
Copy link
Member

@alexeagle alexeagle commented Feb 14, 2025

Created from a commit by @b0inbot :

An example which allows configuring internal details of the formatter. Replaces the switch statement in format.sh with a JSON that is handled. (dont love depending on jq here).

Obviously a lot more is needed for this to be accepted: doc work, porting over mirror_linguist_languages.sh, a format_config or format_extensions function within defs.bzl.

Testing was done by running bazel run format_custom within the test folder and seeing the .bozo file getting processed by the mock yaml formatter.

penne[130][test] $ pwd
/home/boin/Projects/tools/tools/rules_lint/format/test
penne[000][test] $ bazel run format_custom
INFO: Analyzed target //format/test:format_custom (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //format/test:format_custom up-to-date:
  bazel-bin/format/test/format_custom.bash
INFO: Elapsed time: 0.093s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/format/test/format_custom.bash
+ yamlfmt example/hello.bozo
Formatted YAML in 0m0.022s

An example which allows configuring internal details of the
formatter. Replaces the switch statement in format.sh with
a JSON that is handled. (dont love depending on jq here).

Obviously a lot more is needed for this to be accepted: doc work,
porting over mirror_linguist_languages.sh, a format_config or
format_extensions function within defs.bzl.

Testing was done by running bazel run format_custom within
the test folder and seeing the .bozo file getting processed by the
mock yaml formatter.

```
penne[130][test] $ pwd
/home/boin/Projects/tools/tools/rules_lint/format/test
penne[000][test] $ bazel run format_custom
INFO: Analyzed target //format/test:format_custom (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //format/test:format_custom up-to-date:
  bazel-bin/format/test/format_custom.bash
INFO: Elapsed time: 0.093s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/format/test/format_custom.bash
+ yamlfmt example/hello.bozo
Formatted YAML in 0m0.022s
```
@alexeagle alexeagle marked this pull request as draft February 14, 2025 23:03
@CLAassistant
Copy link

CLAassistant commented Jan 23, 2026

CLA assistant check
All committers have signed the CLA.

@b0inbot
Copy link
Contributor

b0inbot commented Jan 27, 2026

Very cool. I'll sign the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants