Sha256: bbddcccbf86aa9beb23b0c51ebae332d18877ac311c7c11b1c425140dfe76d25

Contents?: true

Size: 817 Bytes

Versions: 20

Compression:

Stored size: 817 Bytes

Contents

# frozen_string_literal: true

module Quality
  module Tools
    # Adds 'scalastyle' tool support to quality gem
    class Scalastyle < Tool
      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

20 entries across 20 versions & 1 rubygems

Version Path
quality-40.0.1 lib/quality/tools/scalastyle.rb
quality-40.0.0 lib/quality/tools/scalastyle.rb
quality-39.0.1 lib/quality/tools/scalastyle.rb
quality-38.0.1 lib/quality/tools/scalastyle.rb
quality-38.0.0 lib/quality/tools/scalastyle.rb
quality-37.1.1 lib/quality/tools/scalastyle.rb
quality-37.1.0 lib/quality/tools/scalastyle.rb
quality-37.0.1 lib/quality/tools/scalastyle.rb
quality-37.0.0 lib/quality/tools/scalastyle.rb
quality-36.1.0 lib/quality/tools/scalastyle.rb
quality-36.0.0 lib/quality/tools/scalastyle.rb
quality-35.2.1 lib/quality/tools/scalastyle.rb
quality-35.2.0 lib/quality/tools/scalastyle.rb
quality-35.1.1 lib/quality/tools/scalastyle.rb
quality-35.0.1 lib/quality/tools/scalastyle.rb
quality-35.0.0 lib/quality/tools/scalastyle.rb
quality-34.0.2 lib/quality/tools/scalastyle.rb
quality-34.0.1 lib/quality/tools/scalastyle.rb
quality-34.0.0 lib/quality/tools/scalastyle.rb
quality-33.0.0 lib/quality/tools/scalastyle.rb