You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
536 B
Ruby
19 lines
536 B
Ruby
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
#
|
|
# Copyright (c) 2018-2019 Andre Richter <andre.o.richter@gmail.com>
|
|
|
|
require_relative '../utils/helpers/copyrighted'
|
|
|
|
source_files_exts = ['.S', '.rs', '.rb']
|
|
|
|
staged_files = `git --no-pager diff --name-only --cached`.split(/\n/)
|
|
staged_files.each do |f|
|
|
if f.include?('Makefile') || source_files_exts.include?(File.extname(f))
|
|
puts "Checking for copyright range: #{f}"
|
|
exit 1 unless copyrighted?(f, true)
|
|
end
|
|
end
|