Skip to content

Commit baa0ebc

Browse files
committed
Merge branch 'rubocop'
2 parents 7ddf0ff + 7a0e03e commit baa0ebc

55 files changed

Lines changed: 1327 additions & 1141 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
/.bundle/
2+
/.vendor/
3+
/Gemfile.lock
4+
15
/doc/tutorial/index.html
26
/doc/DBus
37
/doc/*.html
48
/doc/css
59
/doc/js
610
.yardoc/
11+
712
# Rubinius
813
.rbx/
14+
915
# SimpleCov
1016
coverage/
17+
1118
# packaging
1219
ruby-dbus-*.gem

.rubocop.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Do not check code borrowed from ActiveSupport
2+
AllCops:
3+
Exclude:
4+
- 'lib/dbus/core_ext/**/*.rb'
5+
6+
# https://github.com/SUSE/style-guides/blob/master/Ruby.md#strings
7+
Style/StringLiterals:
8+
EnforcedStyle: double_quotes
9+
10+
Style/StringLiteralsInInterpolation:
11+
EnforcedStyle: double_quotes
12+
13+
# https://github.com/SUSE/style-guides/blob/master/Ruby.md#arrays
14+
Style/WordArray:
15+
Enabled: false
16+
17+
Style/IndentationConsistency:
18+
Exclude:
19+
# a conflict between markdown and ruby indentation
20+
- examples/doc/variants.rb
21+
22+
# I am not ready to fix these
23+
Style/IfUnlessModifier:
24+
Enabled: false
25+
26+
# I am not ready to fix these
27+
Style/WhileUntilModifier:
28+
Enabled: false
29+
30+
# I am not ready to fix these
31+
Style/NegatedIf:
32+
Enabled: false
33+
34+
Style/EmptyElse:
35+
EnforcedStyle: "nil"
36+
37+
# Prefer readability over performance
38+
Performance/RedundantBlockCall:
39+
Enabled: false
40+
41+
# Need to check whether API stays OK
42+
Lint/InheritException:
43+
Exclude:
44+
- 'lib/dbus.rb'
45+
- 'lib/dbus/auth.rb'
46+
- 'lib/dbus/bus.rb'
47+
- 'lib/dbus/introspect.rb'
48+
- 'lib/dbus/marshall.rb'
49+
- 'lib/dbus/matchrule.rb'
50+
- 'lib/dbus/message.rb'
51+
- 'lib/dbus/type.rb'
52+
53+
# Offense count: 7
54+
Lint/HandleExceptions:
55+
Exclude:
56+
- 'lib/dbus/marshall.rb'
57+
- 'lib/dbus/message_queue.rb'
58+
- 'lib/dbus/xml.rb'
59+
- 'spec/server_spec.rb'
60+
- 'spec/service_newapi.rb'
61+
62+
# Offense count: 5
63+
Lint/RescueException:
64+
Exclude:
65+
- 'examples/gdbus/gdbus'
66+
- 'examples/no-introspect/nm-test.rb'
67+
- 'lib/dbus/bus.rb'
68+
- 'lib/dbus/message_queue.rb'
69+
70+
Style/PredicateName:
71+
NamePrefix:
72+
# has_ and have_ are allowed
73+
- is_
74+
75+
# Offense count: 1
76+
Lint/Eval:
77+
Exclude:
78+
- 'examples/gdbus/gdbus'
79+
80+
# Offense count: 1
81+
Lint/NestedMethodDefinition:
82+
Exclude:
83+
- 'spec/main_loop_spec.rb'
84+
85+
# Offense count: 34
86+
Metrics/AbcSize:
87+
Max: 123
88+
89+
# Offense count: 2
90+
Metrics/BlockNesting:
91+
Max: 4
92+
93+
# Offense count: 8
94+
# Configuration parameters: CountComments.
95+
Metrics/ClassLength:
96+
Max: 297
97+
98+
# Offense count: 12
99+
Metrics/CyclomaticComplexity:
100+
Max: 36
101+
102+
# Offense count: 62
103+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
104+
# URISchemes: http, https
105+
Metrics/LineLength:
106+
Max: 118
107+
108+
# Offense count: 49
109+
# Configuration parameters: CountComments.
110+
Metrics/MethodLength:
111+
Max: 96
112+
113+
# Offense count: 9
114+
Metrics/PerceivedComplexity:
115+
Max: 27
116+
117+
# Offense count: 8
118+
Style/ClassVars:
119+
Exclude:
120+
- 'lib/dbus/export.rb'
121+
- 'lib/dbus/message.rb'
122+
123+
# Offense count: 16
124+
Style/Documentation:
125+
Exclude:
126+
- 'spec/**/*'
127+
- 'test/**/*'
128+
- 'examples/gdbus/gdbus'
129+
- 'examples/service/service_newapi.rb'
130+
- 'lib/dbus/api_options.rb'
131+
- 'lib/dbus/error.rb'
132+
- 'lib/dbus/logger.rb'
133+
- 'lib/dbus/message.rb'
134+
- 'lib/dbus/message_queue.rb'
135+
- 'lib/dbus/type.rb'
136+
- 'lib/dbus/xml.rb'
137+
138+
# Offense count: 1
139+
Style/OptionalArguments:
140+
Exclude:
141+
- 'lib/dbus/proxy_object_interface.rb'

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sudo: false
12
language: ruby
23
rvm:
34
- "2.3.1"
@@ -7,11 +8,12 @@ rvm:
78
- jruby-9.0.5.0
89
- ruby-head
910
- rbx
10-
gemfile: Gemfile.ci
1111
matrix:
1212
allow_failures:
1313
- rvm: jruby-9.0.5.0
1414
- rvm: ruby-head
1515
- rvm: rbx
1616
env:
17-
- TESTOPTS=-v
17+
global:
18+
- TESTOPTS=-v
19+
- JRUBY_OPTS="--debug"

Gemfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*-ruby -*-
2+
source "https://rubygems.org"
3+
gemspec
4+
5+
group :test do
6+
# Optional dependency, we do want to test with it
7+
gem "nokogiri"
8+
end
9+
10+
platforms :rbx do
11+
gem "racc"
12+
end

Gemfile.ci

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)