How mlawren/githook-perltidy works
Main Components
a. Command Interface Layer
• Main entry point (bin/githook-perltidy)
• Two primary commands: 'install' and 'pre-commit'
b. Core Processing Components
• App::githook::perltidy (main module)
• Installation Handler (App::githook::perltidy::install)
• Pre-commit Handler (App::githook::perltidy::pre_commit)
• CI-specific variants of these components
c. External Tools Integration
• Perl::Tidy
• Perl::Critic
• Pod::Tidy
• Pod::Text (for README generation)
d. Configuration Management
• .perltidyrc / .perltidyrc.sweetened
• .podtidy-opts
• .perlcriticrc
• .readme_from
e. Git Integration
• Git Index interaction
• Git Hooks directory
• Working Directory
Specific Elements
• Rectangles: Core application modules
• Hexagons: External tools (Perl::Tidy, Perl::Critic, etc.)
• Rounded rectangles: Git components
Key Processes to Highlight
a. Installation Flow:
Git Repo → install command → Hook Installation → Git hooks directory
b. Pre-commit Flow:
Git commit → pre-commit hook → File processing → Git index update
Additional Details
• Temporary directory usage
• Error handling paths
• Optional components (Perl::Critic, Pod::Tidy)
• Configuration file dependencies
Notes for Implementation
• Keep the main flow clear and centered
• Related components together
• Use clear labels for all components
• Version information
• Notes about environment variables (NO_GITHOOK_PERLTIDY)
• Easy alignment and spacing
• Export to common formats