This is a very rough version of running arc lint on a Drydock agent and saving the information into Diffusion.
There's a few hacks for Windows here; in particular using %C instead of %s because cmd.exe doesn't like single quotes. It'd be good to have a mode for csprintf to tell it to do Windows-style escaping even through the current machine is UNIX.
Another issue is the race condition-ness of this implementation; technically it could pass the "is there a branch pointing to this", start linting for one commit and then another later commit also triggers and starts linting. This is mostly mitigated by the fact that unless "Lint Everything" is turned on the linting operations will be incremental, but entirely mitigated if "Wait for Previous Builds" is placed before the lint step in a build plan.
Finally, this won't populate the authorPHID field in the lint messages; i.e. it doesn't calculate blame information for the files that are linted. I would like to address this with T5001 at some point so we don't need to recalculate blame every time, to reduce the need for waiting, and to introduce historical aggregated information.