When running tools such as formatters and linting tools with "auto-correction" options, it can be that the input and output for a Rule
are the same file; for example:
"//*.hs" %> \out ->
cmd_ "ormolu" "-m" "inplace" out
-- OR
batch 10 ("//*.hs" %>)
( \out -> do
cmd_ "ormolu" "-m" "inplace" out
pure out
)
(cmd_ "hlint")
This seems to work "correctly" (the rule is re-run if the source file is need
ed and has changed), but we're unsure if this is a happy coincidence or shake
working as designed - especially when we start thinking about cached results from shakeShare
or in the future Cloud Shake. Is this the best way to handle this type of rule, or is there something better?