Open sjn opened 8 years ago
There are two potential parts to your request:
1) Checking that files don't report any issues with Code::TidyAll and preventing the user from committing when they do.
Conceptually, this is very similar to App::GitHooks::Plugin::PerlCritic, and the behavior would be the same as Code::TidyAll::Git::Precommit.
The only potential problem here is the level of detail bubbled up by Code::TidyAll::Result for the line number of issues detected. Several App::GitHooks plugins (for example: App::GitHooks::Plugin::PerlCritic) review the line number(s) of issues, to detect if the issues are in changes you're committing or in changes that predated your current edit. This avoids forcing the user to clean up / fix an entire file if they're just trying to make a one line fix, but it looks like implementing line-level matching would be difficult for Code::TidyAll. The plugin could try to parse the output, but as the output may change over time, the maintenance cost would likely be high.
This doesn't prevent a Code::TidyAll plugin, but it's a trade-off vs implementing specific App::GitHooks plugins for each tool that Code::TidyAll supports.
2) Automatically running Code::TidyAll to clean up the files before they're committed.
This is a difficult problem, in particular because:
git add -p
), and how to stage the corresponding parts of the automatic cleanup.TidyAll::Git::Precommit does not offer this either, possibly for similar reasons.
Hei!
Would it be possible to add support for Code::TidyAll to App::GitHooks? (e.g. as a plugin?)