Add a pre-commit hook

pull/15/head
Andre Richter 5 years ago
parent b4ce7d7e1d
commit 052f3e9d9c
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -0,0 +1,20 @@
#!/usr/bin/env ruby
require_relative '../utils/copyrighted'
source_files_exts = ['.S', '.rs', '.rb']
staged_files = `git --no-pager diff --name-only --cached`.split(/\n/)
need_inspection = []
staged_files.each do |f|
need_inspection << f if
f == 'Makefile' || source_files_exts.include?(File.extname(f))
end
error = false
need_inspection.each do |f|
error = true unless copyrighted?(f, true)
end
exit 1 if error

@ -0,0 +1,3 @@
#!/usr/bin/env bash
git config core.hooksPath .githooks
Loading…
Cancel
Save