From 90b9597d500c528d46aa13ccfa678a86ef7ea22b Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Sun, 21 Feb 2021 04:35:26 -0800 Subject: Add a buildifier fixer for Bazel files (#3499) This fixer enables buildifier's formatting and "lint fix" modes. Additional options can be provided via `bazel_buildifier_options`. It also implements some basic logic for guessing the file's type. buildifier itself usually does this based on the filenames provided on the command line, but because we're piping our buffer via stdin, we need to do this manually. --- doc/ale-bazel.txt | 28 ++++++++++++++++++++++++++++ doc/ale-supported-languages-and-tools.txt | 2 ++ doc/ale.txt | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 doc/ale-bazel.txt (limited to 'doc') diff --git a/doc/ale-bazel.txt b/doc/ale-bazel.txt new file mode 100644 index 00000000..e2922aaf --- /dev/null +++ b/doc/ale-bazel.txt @@ -0,0 +1,28 @@ +=============================================================================== +ALE Bazel Integration *ale-bazel-options* + +=============================================================================== +buildifier *ale-bazel-buildifier* + +g:ale_bazel_buildifier_executable *g:ale_bazel_buildifier_executable* + *b:ale_bazel_buildifier_executable* + Type: |String| + Default: `'buildifier'` + + See |ale-integrations-local-executables| + + +g:ale_bazel_buildifier_options *g:ale_bazel_buildifier_options* + *b:ale_bazel_buildifier_options* + Type: |String| + Default: `''` + + This variable can be set to pass extra options to buildifier. + + +g:ale_bazel_buildifier_use_global *g:ale_bazel_buildifier_use_global* + *b:ale_bazel_buildifier_use_global* + Type: |Number| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index 71abb0a1..cb90de4c 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -43,6 +43,8 @@ Notes: * `shfmt` * Bats * `shellcheck` +* Bazel + * `buildifier` * BibTeX * `bibclean` * Bourne Shell diff --git a/doc/ale.txt b/doc/ale.txt index 3031cd1b..113e29c5 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -2614,6 +2614,8 @@ documented in additional help files. gawk..................................|ale-awk-gawk| bats....................................|ale-bats-options| shellcheck............................|ale-bats-shellcheck| + bazel...................................|ale-bazel-options| + buildifier............................|ale-bazel-buildifier| bib.....................................|ale-bib-options| bibclean..............................|ale-bib-bibclean| c.......................................|ale-c-options| -- cgit v1.2.3