aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/hooks/pre-commit.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/hooks/pre-commit.rb b/tools/hooks/pre-commit.rb
index 83b4978..6e52147 100755
--- a/tools/hooks/pre-commit.rb
+++ b/tools/hooks/pre-commit.rb
@@ -3,6 +3,8 @@
result = 0
files = Dir['src/**/*.h'] + Dir['src/**/*.cpp'] - Dir['src/3rd-party/**/*']
+puts "Running in #{`pwd`}"
+
puts 'Checking licenses...'
files.each { |name|
File.open(name) { |f|
@@ -15,9 +17,12 @@ files.each { |name|
puts 'Checking style...'
if not `astyle --dry-run --formatted --options=astyle.rc #{files.join(' ')}`.empty? then
- system "astyle --verbose --formatted --options=astyle.rc #{files.join(' ')}"
+ system "astyle --verbose --suffix=none --formatted --options=astyle.rc #{files.join(' ')}"
result = 1
end
+puts 'Running cppcheck...'
+`cppcheck --quiet --enable=all --inconclusive --std=posix -I src/ .`
+
puts "pre-commit exit(#{result})"
exit result