]> nos-oignons.net Git - gestion-adh.git/blobdiff - bin/pre-commit-hook
Next step in pre-commit hook implementation
[gestion-adh.git] / bin / pre-commit-hook
index 7d3d0e8f4c8fdbf30c3090afb9944b3191c190fd..fcfb3e91a8fd981c7e970027b5b9507244bd093f 100755 (executable)
@@ -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)