Skip to content

Commit d3b0391

Browse files
author
graham jenson
committed
[Fix] add style checking to rules (buildifier) ruby (rubocop)
update travis updating travis language update fix revert remove
1 parent 9dd48ea commit d3b0391

File tree

6 files changed

+258
-0
lines changed

6 files changed

+258
-0
lines changed

.rubocop.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
AllCops:
2+
Exclude:
3+
- bazel-*/**/*
4+
5+
# Relaxed.Ruby.Style
6+
## Version 2.4
7+
8+
Style/Alias:
9+
Enabled: false
10+
StyleGuide: https://relaxed.ruby.style/#stylealias
11+
12+
Style/AsciiComments:
13+
Enabled: false
14+
StyleGuide: https://relaxed.ruby.style/#styleasciicomments
15+
16+
Style/BeginBlock:
17+
Enabled: false
18+
StyleGuide: https://relaxed.ruby.style/#stylebeginblock
19+
20+
Style/BlockDelimiters:
21+
Enabled: false
22+
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
23+
24+
Style/CommentAnnotation:
25+
Enabled: false
26+
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
27+
28+
Style/Documentation:
29+
Enabled: false
30+
StyleGuide: https://relaxed.ruby.style/#styledocumentation
31+
32+
Layout/DotPosition:
33+
Enabled: false
34+
StyleGuide: https://relaxed.ruby.style/#layoutdotposition
35+
36+
Style/DoubleNegation:
37+
Enabled: false
38+
StyleGuide: https://relaxed.ruby.style/#styledoublenegation
39+
40+
Style/EndBlock:
41+
Enabled: false
42+
StyleGuide: https://relaxed.ruby.style/#styleendblock
43+
44+
Style/FormatString:
45+
Enabled: false
46+
StyleGuide: https://relaxed.ruby.style/#styleformatstring
47+
48+
Style/IfUnlessModifier:
49+
Enabled: false
50+
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
51+
52+
Style/Lambda:
53+
Enabled: false
54+
StyleGuide: https://relaxed.ruby.style/#stylelambda
55+
56+
Style/ModuleFunction:
57+
Enabled: false
58+
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
59+
60+
Style/MultilineBlockChain:
61+
Enabled: false
62+
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
63+
64+
Style/NegatedIf:
65+
Enabled: false
66+
StyleGuide: https://relaxed.ruby.style/#stylenegatedif
67+
68+
Style/NegatedWhile:
69+
Enabled: false
70+
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
71+
72+
Style/NumericPredicate:
73+
Enabled: false
74+
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
75+
76+
Style/ParallelAssignment:
77+
Enabled: false
78+
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
79+
80+
Style/PercentLiteralDelimiters:
81+
Enabled: false
82+
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
83+
84+
Style/PerlBackrefs:
85+
Enabled: false
86+
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
87+
88+
Style/Semicolon:
89+
Enabled: false
90+
StyleGuide: https://relaxed.ruby.style/#stylesemicolon
91+
92+
Style/SignalException:
93+
Enabled: false
94+
StyleGuide: https://relaxed.ruby.style/#stylesignalexception
95+
96+
Style/SingleLineBlockParams:
97+
Enabled: false
98+
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
99+
100+
Style/SingleLineMethods:
101+
Enabled: false
102+
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
103+
104+
Layout/SpaceBeforeBlockBraces:
105+
Enabled: false
106+
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
107+
108+
Layout/SpaceInsideParens:
109+
Enabled: false
110+
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
111+
112+
Style/SpecialGlobalVars:
113+
Enabled: false
114+
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
115+
116+
Style/StringLiterals:
117+
Enabled: false
118+
StyleGuide: https://relaxed.ruby.style/#stylestringliterals
119+
120+
Style/TrailingCommaInArguments:
121+
Enabled: false
122+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
123+
124+
Style/TrailingCommaInArrayLiteral:
125+
Enabled: false
126+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
127+
128+
Style/TrailingCommaInHashLiteral:
129+
Enabled: false
130+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
131+
132+
Style/SymbolArray:
133+
Enabled: false
134+
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
135+
136+
Style/WhileUntilModifier:
137+
Enabled: false
138+
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
139+
140+
Style/WordArray:
141+
Enabled: false
142+
StyleGuide: https://relaxed.ruby.style/#stylewordarray
143+
144+
Lint/AmbiguousRegexpLiteral:
145+
Enabled: false
146+
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
147+
148+
Lint/AssignmentInCondition:
149+
Enabled: false
150+
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
151+
152+
Metrics/AbcSize:
153+
Enabled: false
154+
155+
Metrics/BlockNesting:
156+
Enabled: false
157+
158+
Metrics/ClassLength:
159+
Enabled: false
160+
161+
Metrics/ModuleLength:
162+
Enabled: false
163+
164+
Metrics/CyclomaticComplexity:
165+
Enabled: false
166+
167+
Metrics/LineLength:
168+
Enabled: false
169+
170+
Metrics/MethodLength:
171+
Enabled: false
172+
173+
Metrics/ParameterLists:
174+
Enabled: false
175+
176+
Metrics/PerceivedComplexity:
177+
Enabled: false

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ before_install:
3131
- bazel $BAZEL_OPTS info
3232
- bazel $BAZEL_OPTS fetch --curses=no -- "//ruby/..."
3333
- (cd examples && bazel $BAZEL_OPTS fetch --curses=no -- "//...")
34+
- bundle install
3435
install:
3536
- bazel $BAZEL_OPTS build $BAZEL_BUILD_OPTS --show_progress_rate_limit 0 -- //...
3637
- (cd examples && bazel $BAZEL_OPTS build $BAZEL_BUILD_OPTS --show_progress_rate_limit 0 -- //...)
3738
script:
3839
- bazel $BAZEL_OPTS test $BAZEL_BUILD_OPTS --show_progress_rate_limit 0 --test_output=streamed -- //...
3940
- (cd examples && bazel $BAZEL_OPTS test $BAZEL_BUILD_OPTS --show_progress_rate_limit 0 --test_output=streamed -- //...)
41+
- bazel run :buildifier
42+
- bundle exec rubocop
4043

4144
env:
4245
global:

BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
2+
3+
buildifier(name = "buildifier")
4+
5+
buildifier(
6+
name = "buildifier-check",
7+
mode = "check",
8+
)

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rubocop', '~> 0.76.0', require: false

Gemfile.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.0)
5+
jaro_winkler (1.5.2)
6+
parallel (1.14.0)
7+
parser (2.6.0.0)
8+
ast (~> 2.4.0)
9+
rainbow (3.0.0)
10+
rubocop (0.76.0)
11+
jaro_winkler (~> 1.5.1)
12+
parallel (~> 1.10)
13+
parser (>= 2.6)
14+
rainbow (>= 2.2.2, < 4.0)
15+
ruby-progressbar (~> 1.7)
16+
unicode-display_width (>= 1.4.0, < 1.7)
17+
ruby-progressbar (1.10.0)
18+
unicode-display_width (1.5.0)
19+
20+
PLATFORMS
21+
ruby
22+
23+
DEPENDENCIES
24+
rubocop (~> 0.76.0)
25+
26+
BUNDLED WITH
27+
1.9

WORKSPACE

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,43 @@ local_repository(
1414
name = "bazelruby_ruby_rules_ruby_tests_testdata_another_workspace",
1515
path = "ruby/tests/testdata/another_workspace",
1616
)
17+
18+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
19+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
20+
21+
# installing go for buildifier
22+
http_archive(
23+
name = "io_bazel_rules_go",
24+
sha256 = "842ec0e6b4fbfdd3de6150b61af92901eeb73681fd4d185746644c338f51d4c0",
25+
urls = [
26+
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz",
27+
"https://github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz",
28+
],
29+
)
30+
31+
git_repository(
32+
name = "bazel_gazelle",
33+
commit = "11a9ed24876401ee8b570c04de3a132e62415304",
34+
remote = "https://github.com/bazelbuild/bazel-gazelle",
35+
)
36+
37+
git_repository(
38+
name = "com_google_protobuf",
39+
commit = "09745575a923640154bcf307fba8aedff47f240a",
40+
remote = "https://github.com/protocolbuffers/protobuf",
41+
shallow_since = "1558721209 -0700",
42+
)
43+
44+
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
45+
46+
go_rules_dependencies()
47+
48+
go_register_toolchains(go_version = "1.12.9")
49+
50+
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
51+
52+
gazelle_dependencies()
53+
54+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
55+
56+
protobuf_deps()

0 commit comments

Comments
 (0)