mirror of
https://github.com/rubyjs/mini_racer
synced 2023-03-27 23:21:28 -04:00
Introduce a rake lint task that runs clang-tidy on the source (#139)
This commit is contained in:
parent
7fd2c16be4
commit
cad52dfcb1
1 changed files with 25 additions and 0 deletions
25
Rakefile
25
Rakefile
|
@ -52,3 +52,28 @@ namespace :test do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc 'run clang-tidy linter on mini_racer_extension.cc'
|
||||
task :lint do
|
||||
require 'mkmf'
|
||||
require 'libv8'
|
||||
|
||||
Libv8.configure_makefile
|
||||
|
||||
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
|
||||
'arch_hdrdir' => $arch_hdrdir.quote,
|
||||
'top_srcdir' => $top_srcdir.quote)
|
||||
if $universal and (arch_flag = conf['ARCH_FLAG']) and !arch_flag.empty?
|
||||
conf['ARCH_FLAG'] = arch_flag.gsub(/(?:\G|\s)-arch\s+\S+/, '')
|
||||
end
|
||||
|
||||
checks = %W(bugprone-*
|
||||
cert-*
|
||||
cppcoreguidelines-*
|
||||
clang-analyzer-*
|
||||
performance-*
|
||||
portability-*
|
||||
readability-*).join(',')
|
||||
|
||||
sh RbConfig::expand("clang-tidy -checks='#{checks}' ext/mini_racer_extension/mini_racer_extension.cc -- #$INCFLAGS #$CPPFLAGS", conf)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue