pre-commit �� ��U �����U #!/usr/bin/env perl use strict; use warnings; use Perl::Metrics::Simple; use constant { EXIT_STATUS_SUCCESS => 0, PERL_MODULE_FILENAME_PATTERN => qr/\.(pm|pl)$/, LIMIT_LINES_OF_CODE => 150, BASE_COMMIT => '9e732c2', }; sub is_empty_git_history { system "git rev-parse --verify HEAD >/dev/null 2>&1"; return $? != EXIT_STATUS_SUCCESS; } sub get_modified_files { my $output = `
![ある歴史(BASE_COMMIT)以降に新規追加されたファイルが150行を超えたときにcommitをしないための、決意のpre-commit hookを書きました。](https://cdn-ak-scissors.b.st-hatena.com/image/square/1ef26f6cb4349557952890dbe3e567f7f98dc151/height=288;version=1;width=512/https%3A%2F%2Fgithub.githubassets.com%2Fassets%2Fgist-og-image-54fd7dc0713e.png)