Sha256: e81c516d915bdf9ef0c14aed9a76b7f3e905a37a1418ce7ba9bf4cab70d99ad7

Contents?: true

Size: 1.15 KB

Versions: 29

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

require "bundler/gem_tasks"
require "rufo"

begin
  require "rspec/core/rake_task"
  RSpec::Core::RakeTask.new(:spec)
end

require "rubocop/rake_task"
RuboCop::RakeTask.new

desc "Alias for `rake rufo:run`"
task :format => ["rufo:run"]

namespace :rufo do
  require "rufo"

  def rufo_command(*switches, rake_args)
    files_or_dirs = rake_args[:files_or_dirs] || "."
    args = switches + files_or_dirs.split(" ")
    Rufo::Command.run(args)
  end

  desc "Format Ruby code in current directory"
  task :run, [:files_or_dirs] do |_task, rake_args|
    rufo_command(rake_args)
  end

  desc "Check that no formatting changes are produced"
  task :check, [:files_or_dirs] do |_task, rake_args|
    rufo_command("--check", rake_args)
  end
end

desc "Generate test protobuf stubs"
task :gen_test_proto do
  system "grpc_tools_ruby_protoc --ruby_out=. --grpc_out=. spec/support/grpc_service/test.proto"
  Rufo::Command.run(["spec/support/grpc_service/test_pb.rb", "spec/support/grpc_service/test_services_pb.rb"])
end

task :fix => %w[rufo:run rubocop:auto_correct]

task :verify => %w[spec rufo:check rubocop]

task :default => %w[verify build]

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
gitlab-labkit-0.16.2 Rakefile
gitlab-labkit-0.16.1 Rakefile
gitlab-labkit-0.16.0 Rakefile
gitlab-labkit-0.15.0 Rakefile
gitlab-labkit-0.14.0 Rakefile
gitlab-labkit-0.13.5 Rakefile
gitlab-labkit-0.13.4 Rakefile
gitlab-labkit-0.13.3 Rakefile
gitlab-labkit-0.13.2 Rakefile
gitlab-labkit-0.13.1 Rakefile
gitlab-labkit-0.13.0 Rakefile
gitlab-labkit-0.12.2 Rakefile
gitlab-labkit-0.12.1 Rakefile
gitlab-labkit-0.12.0 Rakefile
gitlab-labkit-0.11.0 Rakefile
gitlab-labkit-0.10.1 Rakefile
gitlab-labkit-0.10.0 Rakefile
gitlab-labkit-0.9.1 Rakefile
gitlab-labkit-0.9.0 Rakefile
gitlab-labkit-0.8.0 Rakefile