Is it possible for Shake to change a source file?

16 views
Skip to first unread message

mic...@mavnn.co.uk

unread,
Sep 5, 2019, 4:43:49 AM9/5/19
to Shake build system
I'm wondering if anyone can help out with a question about Rules for tasks like linting and formatting where a "source file" is changed by a Rule. There's a nicely formatted version on StackOverflow at https://stackoverflow.com/questions/57789583/is-it-possible-for-shake-to-change-a-source-file , but it boils down to - given "ormolu" is a formatting tool, is this a valid Rule?

  "//*.hs" %> \out ->
    cmd_ "ormolu" "-m" "inplace" out

To me it looks like this should be fine (when an *.hs file is needed, we format it first), but it's not clear from the docs if this is supported (effectively a file that depends on itself to detect changes).

Many thanks!

Michael

Reply all
Reply to author
Forward
0 new messages