summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-07 23:20:14 +0000
committerw0rp <devw0rp@gmail.com>2017-11-07 23:20:14 +0000
commit1bf894f48c2169e18e5978c9347e40f186e425ab (patch)
tree9f61a99476233e80b70ab4f4efaecdb60f887d10 /doc
parentd97924b6986216aea3eae68a3fdc27b9bde341bb (diff)
downloadale-1bf894f48c2169e18e5978c9347e40f186e425ab.zip
Fix #1086 - Implement command chaining for fixers
Diffstat (limited to 'doc')
-rw-r--r--doc/ale.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/ale.txt b/doc/ale.txt
index 67a5a130..d3efcc13 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -443,6 +443,26 @@ are supported for running the commands.
for commands which need to modify some file on disk in
order to fix files.
+ `chain_with` An optional key for defining a callback to call next.
+
+ The callback must accept two or three arguments,
+ `(buffer, output)` or `(buffer, output, input)` .
+ Functions receiving a variable number of arguments will
+ only receive the first two values. The `output` argument
+ will contain the lines of output from the command run.
+ The `input` argument is the List of lines for the
+ buffer, after applying any previous fixers.
+
+ The callback must return the same values returned for
+ any fixer function. This allows fixer functions to be
+ chained recursively.
+
+ When the command string returned for a fixer is an empty
+ string, the next command in the chain will still be run.
+ This allows commands to be skipped, like version checks
+ that are cached. An empty List will be passed to the
+ next callback in the chain for the `output`.
+
*ale-fix-configuration*
Synchronous functions and asynchronous jobs will be run in a sequence for