diff options
Diffstat (limited to 'rakelib')
| -rw-r--r-- | rakelib/gcc.rake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rakelib/gcc.rake b/rakelib/gcc.rake index b1f8c18..ce02bb6 100644 --- a/rakelib/gcc.rake +++ b/rakelib/gcc.rake @@ -150,6 +150,17 @@ namespace :gcc do sh 'make', 'check-elna', chdir: File.join(HOST_GCC, 'gcc') end + desc 'Run clang-tidy' + task :tidy do + compile_db = Pathname.new 'compile_commands.json' + + raise "#{compile_db} is missing. Run: bear -- rake gcc:make" unless compile_db.exist? + sources = FileList['boot/*.cc', 'include/elna/boot/*.h'].exclude do |f| + f.include?('generated/') + end + sh 'clang-tidy', '-p', compile_db.to_path, '--extra-arg=-w', '--warnings-as-errors=*', *sources + end + desc 'Build documentation' task :doc do sh 'make', 'html', chdir: File.join(HOST_GCC, 'gcc') |
