diff options
Diffstat (limited to 'tools/hooks')
-rwxr-xr-x | tools/hooks/pre-commit.rb | 7 |
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 |