X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/e4000b47cf37576b44d21dc088601d619a6e5261..41e506595f4d41915f59f93e1f11c926cc3bfae1:/bin/pre-commit-hook diff --git a/bin/pre-commit-hook b/bin/pre-commit-hook index 7d3d0e8..fcfb3e9 100755 --- a/bin/pre-commit-hook +++ b/bin/pre-commit-hook @@ -19,12 +19,15 @@ def is_valid_subscription?(content) return false if content.length == 0 return false unless content.start_with?("---\n") begin - YAML.load(content) - true + data = YAML.load(content) rescue ArgumentError # Parse error - false + return false end + ['name', 'email'].each do |key| + return false unless data.include?(key) + end + true end def is_valid_subscription_file?(file)