Sha256: 78b1962578177f6a3c8ac69aeba8b8702ec555b0e63d777bd765966bf7befa37

Contents?: true

Size: 897 Bytes

Versions: 3

Compression:

Stored size: 897 Bytes

Contents

module Quality
  module Tools
    # Adds 'cane' tool support to quality gem
    module Cane
      private

      def cane_exclude_args
        [
          "--abc-exclude '#{source_files_exclude_glob}'",
          "--style-exclude '#{source_files_exclude_glob}'",
          "--doc-exclude '#{source_files_exclude_glob}'",
        ]
      end

      def cane_args
        args = [
          "-f '#{ruby_files_glob}'",
        ]
        args += cane_exclude_args unless exclude_files.empty?
        args.join(' ')
      end

      def quality_cane
        ratchet_quality_cmd('cane', gives_error_code_on_violations: true,
                                    args: cane_args,
                                    emacs_format: true) do |line|
          if line =~ /\(([0-9]*)\):$/
            Regexp.last_match[1].to_i
          else
            0
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
quality-22.0.0 lib/quality/tools/cane.rb
quality-21.0.6 lib/quality/tools/cane.rb
quality-21.0.5 lib/quality/tools/cane.rb