lib/quality/rake/config.rb in quality-6.0.0 vs lib/quality/rake/config.rb in quality-7.0.0

- old
+ new

@@ -1,5 +1,9 @@ +# XXX: I should figure out how to use tagged releases in github. Example: +# https://github.com/xsc/lein-ancient/issues/29 +# https://github.com/xsc/lein-ancient/releases + # XXX: This should be moved out of rake directory module Quality # Configuration for running quality tool class Config # Name of quality task. @@ -30,10 +34,14 @@ # files to analyze. # # Defaults to the same as ruby_dirs attr_writer :source_dirs + # Pick any extra files that are source files, but may not have + # extensions--defaults to ['Rakefile'] + attr_accessor :extra_files + # Relative path to output directory where *_high_water_mark # files will be read/written # # Defaults to . attr_accessor :output_dir @@ -44,13 +52,19 @@ def source_dirs @source_dirs ||= ruby_dirs.clone end + def extra_files + @extra_files ||= ['Rakefile'] + end + def source_files_glob(dirs = source_dirs, - extensions = 'rb,swift,cpp,c,java,py,clj,cljs') - File.join("{#{dirs.join(',')}}", '**', "*.{#{extensions}}") + extensions = + 'rb,swift,cpp,c,java,py,clj,cljs,scala,js') + File.join("{#{dirs.join(',')}}", '**', + "{#{extra_files.join(',')},*.{#{extensions}}}") end def ruby_files_glob source_files_glob(ruby_dirs, 'rb') end @@ -61,10 +75,11 @@ end def initialize(quality_name: 'quality', ratchet_name: 'ratchet', globber: fail) - @quality_name, @ratchet_name = quality_name, ratchet_name + @quality_name = quality_name + @ratchet_name = ratchet_name @skip_tools = [] @output_dir = 'metrics' @verbose = false @globber = globber end