Skip to content

Commit

Permalink
[Truffle] Tool to find files with missing copyright information.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Mar 22, 2015
1 parent 689f75a commit 6af11f2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tool/truffle-missing-copyright-info.rb
@@ -0,0 +1,24 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

failures = false

Dir.glob('truffle/**/*').each do |file|
next if file.start_with? 'truffle/target/generated-sources'
next if file == 'truffle/pom.rb'
if file =~ /.*\.(rb|java)/
lines = IO.readlines(file)
unless (lines[0] + lines[1]) =~ /.*Copyright \(c\).*/
puts 'These files are missing copyright information:' unless failures
puts file
failures = true
end
end
end

exit 1 if failures

0 comments on commit 6af11f2

Please sign in to comment.