summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-06-19 19:47:35 +0900
committerGitHub <noreply@github.com>2021-06-19 11:47:35 +0100
commit88817b3780109c3935200546459d3d35806a90a0 (patch)
tree94cc132c075a5b5ff43e9df1d5104a9d95d296cf /doc
parent2c8a857262d9fd8523938ca07eed590de1224fd3 (diff)
downloadale-88817b3780109c3935200546459d3d35806a90a0.zip
Fix 3167 - add custom fixer example to help docs. (#3541)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
Diffstat (limited to 'doc')
-rw-r--r--doc/ale.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/ale.txt b/doc/ale.txt
index 62881503..a126f360 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -3734,6 +3734,21 @@ ale#fix#registry#Add(name, func, filetypes, desc, [aliases])
ALE will search for fixers in the registry first by `name`, then by their
`aliases`.
+ For example to register a custom fixer for `luafmt`: >
+
+ function! FormatLua(buffer) abort
+ return {
+ \ 'command': 'luafmt --stdin'
+ \}
+ endfunction
+
+ execute ale#fix#registry#Add('luafmt', 'FormatLua', ['lua'], 'luafmt for lua')
+
+ " You can now use it in g:ale_fixers
+ let g:ale_fixers = {
+ \ 'lua': ['luafmt']
+ }
+<
ale#linter#Define(filetype, linter) *ale#linter#Define()*