Sha256: 0ee9cf865b298986b025d7ebbc202eddcd3b8798d200452a5fb611031446808a

Contents?: true

Size: 826 Bytes

Versions: 16

Compression:

Stored size: 826 Bytes

Contents

# frozen_string_literal: true

module Quality
  module Tools
    # Adds 'scalastyle' tool support to quality gem
    module Scalastyle
      private

      def scalastyle_args
        c = " -c '#{scalastyle_config}' " if scalastyle_config
        x = " -x '#{scalastyle_exclude}' " if scalastyle_exclude
        args = ''
        args += c if c
        args += x if x
        args += scala_files.join(' ')
        args
      end

      def quality_scalastyle
        ratchet_quality_cmd('scalastyle',
                            args: scalastyle_args,
                            gives_error_code_on_no_relevant_code: true,
                            gives_error_code_on_violations: true) do |line|
          if line =~ /file=/
            1
          else
            0
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
quality-32.1.1 lib/quality/tools/scalastyle.rb
quality-32.1.0 lib/quality/tools/scalastyle.rb
quality-32.0.0 lib/quality/tools/scalastyle.rb
quality-31.3.0 lib/quality/tools/scalastyle.rb
quality-31.2.1 lib/quality/tools/scalastyle.rb
quality-31.2.0 lib/quality/tools/scalastyle.rb
quality-31.1.0 lib/quality/tools/scalastyle.rb
quality-31.0.0 lib/quality/tools/scalastyle.rb
quality-30.0.1 lib/quality/tools/scalastyle.rb
quality-30.0.0 lib/quality/tools/scalastyle.rb
quality-29.0.0 lib/quality/tools/scalastyle.rb
quality-28.0.0 lib/quality/tools/scalastyle.rb
quality-27.4.0 lib/quality/tools/scalastyle.rb
quality-27.3.1 lib/quality/tools/scalastyle.rb
quality-27.3.0 lib/quality/tools/scalastyle.rb
quality-27.2.0 lib/quality/tools/scalastyle.rb