diff --git a/.decent_ci-Linux.yaml b/.decent_ci-Linux.yaml index 246241a..0b4b9d8 100644 --- a/.decent_ci-Linux.yaml +++ b/.decent_ci-Linux.yaml @@ -27,4 +27,8 @@ compilers: cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON - name: cppcheck compiler_extra_flags: --enable=all -I include --inline-suppr -Umax --suppress="*:cmake*" --suppress="*:unittests/catch.hpp" --force + - name: custom_check + commands: + - ./contrib/check_for_tabs.rb + diff --git a/contrib/check_for_tabs.rb b/contrib/check_for_tabs.rb new file mode 100755 index 0000000..bee7d0d --- /dev/null +++ b/contrib/check_for_tabs.rb @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +require 'json' + +`grep -rPIHn '\t' src/* include/* samples/*`.lines { |line| + if /(?.+(hpp|cpp|chai)):(?[0-9]+):(?.+)/ =~ line + puts(JSON.dump({:line => linenumber, :filename => filename, :tool => "tab_checker", :message => "Source Code Line Contains Tabs", :messagetype => "warning"})) + end +} + +