Skip to content

Commit fa7c2ea

Browse files
author
graham jenson
committed
rubocop and buildifier style fixes
1 parent d3b0391 commit fa7c2ea

39 files changed

+453
-403
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ install:
3838
script:
3939
- bazel $BAZEL_OPTS test $BAZEL_BUILD_OPTS --show_progress_rate_limit 0 --test_output=streamed -- //...
4040
- (cd examples && bazel $BAZEL_OPTS test $BAZEL_BUILD_OPTS --show_progress_rate_limit 0 --test_output=streamed -- //...)
41-
- bazel run :buildifier
41+
# If this fails run `bazel run :buildifier`
42+
- bazel run :buildifier-check
43+
# If this fails run `bundle exec rubocop -a`
4244
- bundle exec rubocop
4345

4446
env:

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

3-
gem 'rubocop', '~> 0.76.0', require: false
5+
gem 'rubocop', '~> 0.76.0', require: false

examples/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
66

77
gem 'rspec', '~> 3.7.0'

examples/bin/show_version.rb

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/ruby
2+
# frozen_string_literal: true
23

34
require 'foo'
45

5-
bar = Foo::Bar.new
6+
Foo::Bar.new
67
puts Foo::VERSION

examples/lib/foo.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Foo
24
require 'foo/bar'
35
require 'foo/version'

examples/lib/foo/bar.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'openssl'
24

35
module Foo

examples/lib/foo/version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Foo
24
VERSION = "0.0.1"
35
end

examples/spec/foo/version_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require_relative '../spec_helper'
24
require 'foo/version'
35

examples/spec/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
RSpec.configure do |config|
24
config.expect_with :rspec do |expectations|
35
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
@@ -11,7 +13,7 @@
1113

1214
config.warnings = true
1315
config.filter_run_when_matching :focus
14-
#config.disable_monkey_patching!
16+
# config.disable_monkey_patching!
1517
config.order = :random
1618
Kernel.srand config.seed
1719
end

ruby/def.bzl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ load(
22
"@bazelruby_ruby_rules//ruby/private:library.bzl",
33
_library = "ruby_library",
44
)
5-
65
load(
76
"@bazelruby_ruby_rules//ruby/private:binary.bzl",
87
_binary = "ruby_binary",
98
_test = "ruby_test",
109
)
1110

1211
def ruby_library(**attrs):
13-
print("//ruby:def.bzl was deprecated and will be removed soon. Use //ruby:defs.bzl instead")
14-
_library(**attrs)
12+
print("//ruby:def.bzl was deprecated and will be removed soon. Use //ruby:defs.bzl instead")
13+
_library(**attrs)
1514

1615
def ruby_binary(**attrs):
17-
print("//ruby:def.bzl was deprecated and will be removed soon. Use //ruby:defs.bzl instead")
18-
_binary(**attrs)
16+
print("//ruby:def.bzl was deprecated and will be removed soon. Use //ruby:defs.bzl instead")
17+
_binary(**attrs)
1918

2019
def ruby_test(**attrs):
21-
print("//ruby:def.bzl was deprecated and will be removed soon. Use //ruby:defs.bzl instead")
22-
_test(**attrs)
20+
print("//ruby:def.bzl was deprecated and will be removed soon. Use //ruby:defs.bzl instead")
21+
_test(**attrs)

0 commit comments

Comments
 (0)