aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-01-20 13:59:12 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-01-20 13:59:12 +0100
commitf84f7bf1b35efa793cb3ff893a97e8b65982c01b (patch)
treedd7f3d665b417d57a9cc232c0b9b5083b0139c42 /tools
parentAdded comments to PKGBUILD (diff)
downloadsmolbote-f84f7bf1b35efa793cb3ff893a97e8b65982c01b.tar.xz
Fixed repo location in license headers
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-license.rb (renamed from tools/hooks/pre-commit.rb)9
-rwxr-xr-xtools/gen_authors.rb18
-rwxr-xr-xtools/gen_authors.sh20
3 files changed, 22 insertions, 25 deletions
diff --git a/tools/hooks/pre-commit.rb b/tools/check-license.rb
index 825a851..8eeb6bb 100755
--- a/tools/hooks/pre-commit.rb
+++ b/tools/check-license.rb
@@ -1,19 +1,18 @@
#!/usr/bin/env ruby
result = 0
-files = Dir.glob("src/**/*.h") + Dir.glob("src/**/*.cpp") + Dir.glob("lib/**/*.h") + Dir.glob("lib/**/*.cpp")
-
-puts "pre-commit: #{`pwd`}"
+files = Dir.glob("src/**/*.h") + Dir.glob("src/**/*.cpp") \
+ + Dir.glob("lib/**/*.h") + Dir.glob("lib/**/*.cpp") \
+ + Dir.glob("plugins/**/*.h") + Dir.glob("plugins/**/*.cpp")
puts 'Checking licenses...'
files.each { |name|
File.open(name) { |file|
if file.grep(/SPDX-License-Identifier/).empty? then
puts "Missing or incorrect license header: #{name}"
- result = 1
+ result += 1
end
}
}
-puts "pre-commit exit(#{result})"
exit result
diff --git a/tools/gen_authors.rb b/tools/gen_authors.rb
new file mode 100755
index 0000000..96f2679
--- /dev/null
+++ b/tools/gen_authors.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+# Generate list of authors from repository commits
+
+log = `hg log --template='{author}'%`
+
+authors = Hash.new(0)
+log.split('%').each do |i|
+ authors[i] += 1
+end
+
+# sort list by descending number of commits
+authors = authors.sort_by {|k, v| v}.reverse
+
+# print out authors
+authors.each do |k, v|
+ #print " #{k} (#{v})\n"
+ print " #{k}\n"
+end
diff --git a/tools/gen_authors.sh b/tools/gen_authors.sh
deleted file mode 100755
index ed24634..0000000
--- a/tools/gen_authors.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# Generate a list of everyone who has contributed to the project merging those
-# who commited under two names or email addresses.
-# Original: https://github.com/Arora/arora/blob/master/generateAuthors
-#
-# To can pass an arg (which goes to git log)
-# Example: to see everyone who contributed between tag 0.6 and now
-# ./generateAuthors 0.6..HEAD
-#
-# Currently this is sorted based on # of commits, sorting contributions is not
-# a simple topic as pointed out in this article http://lwn.net/Articles/222773/
-#
-
-# List of aliases
-# Aqua, Aqua-sama <aqua@iserlohn-fortress.net>, Xian Nox, xiannox <xian.nox@gmail.com>
-
-hg log --template='{author}\n' \
- | sort | uniq -c | sort -n -r \
- | sed -e 's/^ *[0-9]* / /g'