feedjira 3.0.0.beta1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE/feed-parsing.md +15 -0
- data/.github/workflows/ruby.yml +39 -0
- data/.rubocop.yml +18 -628
- data/.rubocop_todo.yml +11 -0
- data/CHANGELOG.md +66 -9
- data/Gemfile +4 -1
- data/README.md +10 -1
- data/Rakefile +3 -1
- data/feedjira.gemspec +14 -12
- data/lib/feedjira.rb +9 -3
- data/lib/feedjira/atom_entry_utilities.rb +51 -0
- data/lib/feedjira/configuration.rb +6 -3
- data/lib/feedjira/core_ext.rb +2 -0
- data/lib/feedjira/core_ext/date.rb +3 -2
- data/lib/feedjira/core_ext/string.rb +2 -1
- data/lib/feedjira/core_ext/time.rb +10 -10
- data/lib/feedjira/date_time_utilities.rb +8 -10
- data/lib/feedjira/date_time_utilities/date_time_epoch_parser.rb +3 -2
- data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +4 -4
- data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +9 -13
- data/lib/feedjira/feed.rb +3 -3
- data/lib/feedjira/feed_entry_utilities.rb +15 -8
- data/lib/feedjira/feed_utilities.rb +5 -4
- data/lib/feedjira/parser.rb +2 -0
- data/lib/feedjira/parser/atom.rb +5 -7
- data/lib/feedjira/parser/atom_entry.rb +4 -21
- data/lib/feedjira/parser/atom_feed_burner.rb +4 -3
- data/lib/feedjira/parser/atom_feed_burner_entry.rb +7 -18
- data/lib/feedjira/parser/atom_google_alerts.rb +26 -0
- data/lib/feedjira/parser/atom_google_alerts_entry.rb +21 -0
- data/lib/feedjira/parser/atom_youtube.rb +2 -1
- data/lib/feedjira/parser/atom_youtube_entry.rb +8 -7
- data/lib/feedjira/parser/globally_unique_identifier.rb +21 -0
- data/lib/feedjira/parser/google_docs_atom.rb +4 -4
- data/lib/feedjira/parser/google_docs_atom_entry.rb +3 -19
- data/lib/feedjira/parser/itunes_rss.rb +4 -3
- data/lib/feedjira/parser/itunes_rss_category.rb +6 -5
- data/lib/feedjira/parser/itunes_rss_item.rb +5 -8
- data/lib/feedjira/parser/itunes_rss_owner.rb +2 -1
- data/lib/feedjira/parser/json_feed.rb +4 -2
- data/lib/feedjira/parser/json_feed_item.rb +7 -1
- data/lib/feedjira/parser/podlove_chapter.rb +3 -2
- data/lib/feedjira/parser/rss.rb +4 -2
- data/lib/feedjira/parser/rss_entry.rb +3 -28
- data/lib/feedjira/parser/rss_feed_burner.rb +3 -2
- data/lib/feedjira/parser/rss_feed_burner_entry.rb +6 -26
- data/lib/feedjira/parser/rss_image.rb +2 -0
- data/lib/feedjira/preprocessor.rb +3 -3
- data/lib/feedjira/rss_entry_utilities.rb +53 -0
- data/lib/feedjira/version.rb +3 -1
- data/spec/feedjira/configuration_spec.rb +5 -3
- data/spec/feedjira/date_time_utilities_spec.rb +2 -0
- data/spec/feedjira/feed_entry_utilities_spec.rb +4 -2
- data/spec/feedjira/feed_spec.rb +3 -1
- data/spec/feedjira/feed_utilities_spec.rb +5 -3
- data/spec/feedjira/parser/atom_entry_spec.rb +7 -4
- data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +7 -5
- data/spec/feedjira/parser/atom_feed_burner_spec.rb +4 -2
- data/spec/feedjira/parser/atom_google_alerts_entry_spec.rb +34 -0
- data/spec/feedjira/parser/atom_google_alerts_spec.rb +62 -0
- data/spec/feedjira/parser/atom_spec.rb +30 -9
- data/spec/feedjira/parser/atom_youtube_entry_spec.rb +8 -6
- data/spec/feedjira/parser/atom_youtube_spec.rb +6 -4
- data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +2 -0
- data/spec/feedjira/parser/google_docs_atom_spec.rb +2 -0
- data/spec/feedjira/parser/itunes_rss_item_spec.rb +3 -1
- data/spec/feedjira/parser/itunes_rss_owner_spec.rb +2 -0
- data/spec/feedjira/parser/itunes_rss_spec.rb +11 -9
- data/spec/feedjira/parser/json_feed_item_spec.rb +5 -3
- data/spec/feedjira/parser/json_feed_spec.rb +2 -0
- data/spec/feedjira/parser/podlove_chapter_spec.rb +2 -0
- data/spec/feedjira/parser/rss_entry_spec.rb +26 -4
- data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +9 -7
- data/spec/feedjira/parser/rss_feed_burner_spec.rb +3 -1
- data/spec/feedjira/parser/rss_spec.rb +2 -0
- data/spec/feedjira/preprocessor_spec.rb +4 -2
- data/spec/feedjira_spec.rb +22 -1
- data/spec/sample_feeds.rb +7 -3
- data/spec/sample_feeds/InvalidDateFormat.xml +20 -0
- data/spec/sample_feeds/Permalinks.xml +22 -0
- data/spec/sample_feeds/a10.xml +72 -0
- data/spec/sample_feeds/atom_simple_single_entry.xml +17 -0
- data/spec/sample_feeds/atom_simple_single_entry_link_self.xml +17 -0
- data/spec/sample_feeds/google_alerts_atom.xml +1 -0
- data/spec/spec_helper.rb +3 -7
- metadata +44 -47
- data/.travis.yml +0 -37
- data/Dangerfile +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: db9d2eb01b3bf275ae7d0599df9bef74ea336ddfb9afdcc31998c4f79890cf51
|
4
|
+
data.tar.gz: 30de1f11b4054c3860ca79a27f8fb54b2244e8140bd26340d3f64f84c2d29884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a83a5507737ed80d62515733dad8005f0f3d0bce59558d6b6f252a94084d459b664b7a56c5355d853cb706b62c1a7c804e5bd68df74f4cb9091bc12ce475d075
|
7
|
+
data.tar.gz: 8af825f5c5cde56ba80d69cbd7d55b1e36e4cb2c6c401f7092a9a8654757fcc133666dbd7ad38527b45f790523aa5449c29dd6886f43112dac49c328ccce816d
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
name: Feed Parsing
|
3
|
+
about: Your feed is parsing incorrectly, or you have a feed type that is not supported
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
### Steps to reproduce
|
11
|
+
<!-- (Guidelines for creating a bug report are [available
|
12
|
+
here](https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#creating-a-bug-report)) -->
|
13
|
+
|
14
|
+
### Example feed URL
|
15
|
+
<!-- Tell us what should happen -->
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
os: [ubuntu]
|
15
|
+
ruby: [2.5, 2.6, 2.7, 3.0]
|
16
|
+
handler: [nokogiri, ox, oga]
|
17
|
+
exclude:
|
18
|
+
- { ruby: jruby, handler: ox }
|
19
|
+
|
20
|
+
name: >-
|
21
|
+
${{matrix.os}}-ruby-${{matrix.ruby}}-${{matrix.handler}}
|
22
|
+
runs-on: ${{matrix.os}}-latest
|
23
|
+
continue-on-error: ${{matrix.ruby == 'head' || matrix.ruby == 'jruby'}}
|
24
|
+
env:
|
25
|
+
HANDLER: ${{matrix.handler}}
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- name: Check out
|
29
|
+
uses: actions/checkout@v2
|
30
|
+
|
31
|
+
- name: Set up ruby and bundle
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
with:
|
34
|
+
ruby-version: ${{matrix.ruby}}
|
35
|
+
bundler-cache: true
|
36
|
+
|
37
|
+
- name: Run rake
|
38
|
+
run: |
|
39
|
+
bundle exec rake
|
data/.rubocop.yml
CHANGED
@@ -1,644 +1,34 @@
|
|
1
|
-
|
2
|
-
Exclude:
|
3
|
-
- db/schema.rb
|
4
|
-
- vendor/**/*
|
5
|
-
|
6
|
-
Naming/AccessorMethodName:
|
7
|
-
Description: Check the naming of accessor methods for get_/set_.
|
8
|
-
Enabled: false
|
9
|
-
|
10
|
-
Style/Alias:
|
11
|
-
Description: 'Use alias_method instead of alias.'
|
12
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
Style/ArrayJoin:
|
16
|
-
Description: 'Use Array#join instead of Array#*.'
|
17
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
Style/AsciiComments:
|
21
|
-
Description: 'Use only ascii symbols in comments.'
|
22
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Naming/AsciiIdentifiers:
|
26
|
-
Description: 'Use only ascii symbols in identifiers.'
|
27
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
Style/Attr:
|
31
|
-
Description: 'Checks for uses of Module#attr.'
|
32
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
33
|
-
Enabled: false
|
34
|
-
|
35
|
-
Metrics/BlockNesting:
|
36
|
-
Description: 'Avoid excessive block nesting'
|
37
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Style/CaseEquality:
|
41
|
-
Description: 'Avoid explicit use of the case equality operator(===).'
|
42
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
43
|
-
Enabled: false
|
44
|
-
|
45
|
-
Style/CharacterLiteral:
|
46
|
-
Description: 'Checks for uses of character literals.'
|
47
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
48
|
-
Enabled: false
|
49
|
-
|
50
|
-
Style/ClassAndModuleChildren:
|
51
|
-
Description: 'Checks style of children classes and modules.'
|
52
|
-
Enabled: true
|
53
|
-
EnforcedStyle: nested
|
54
|
-
|
55
|
-
Metrics/ClassLength:
|
56
|
-
Description: 'Avoid classes longer than 100 lines of code.'
|
57
|
-
Enabled: false
|
58
|
-
|
59
|
-
Metrics/ModuleLength:
|
60
|
-
Description: 'Avoid modules longer than 100 lines of code.'
|
61
|
-
Enabled: false
|
62
|
-
|
63
|
-
Style/ClassVars:
|
64
|
-
Description: 'Avoid the use of class variables.'
|
65
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
66
|
-
Enabled: false
|
67
|
-
|
68
|
-
Style/CollectionMethods:
|
69
|
-
Enabled: true
|
70
|
-
PreferredMethods:
|
71
|
-
find: detect
|
72
|
-
inject: reduce
|
73
|
-
collect: map
|
74
|
-
find_all: select
|
1
|
+
inherit_from: .rubocop_todo.yml
|
75
2
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
Enabled: false
|
80
|
-
|
81
|
-
Style/CommentAnnotation:
|
82
|
-
Description: >-
|
83
|
-
Checks formatting of special comments
|
84
|
-
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
85
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
86
|
-
Enabled: false
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.5
|
5
|
+
NewCops: enable
|
87
6
|
|
7
|
+
# Offense count: 3
|
8
|
+
# Configuration parameters: IgnoredMethods.
|
88
9
|
Metrics/AbcSize:
|
89
|
-
|
90
|
-
A calculated magnitude based on number of assignments,
|
91
|
-
branches, and conditions.
|
92
|
-
Enabled: false
|
10
|
+
Max: 24
|
93
11
|
|
12
|
+
# Offense count: 33
|
13
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
|
14
|
+
# ExcludedMethods: refine
|
94
15
|
Metrics/BlockLength:
|
95
|
-
|
96
|
-
Max: 25
|
97
|
-
ExcludedMethods: []
|
98
|
-
Exclude:
|
99
|
-
- "spec/**/*"
|
100
|
-
|
101
|
-
Metrics/CyclomaticComplexity:
|
102
|
-
Description: >-
|
103
|
-
A complexity metric that is strongly correlated to the number
|
104
|
-
of test cases needed to validate a method.
|
105
|
-
Enabled: false
|
106
|
-
|
107
|
-
Rails/Delegate:
|
108
|
-
Description: 'Prefer delegate method for delegations.'
|
109
|
-
Enabled: false
|
110
|
-
|
111
|
-
Style/PreferredHashMethods:
|
112
|
-
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
113
|
-
StyleGuide: '#hash-key'
|
114
|
-
Enabled: false
|
115
|
-
|
116
|
-
Style/Documentation:
|
117
|
-
Description: 'Document classes and non-namespace modules.'
|
118
|
-
Enabled: false
|
119
|
-
|
120
|
-
Style/DoubleNegation:
|
121
|
-
Description: 'Checks for uses of double negation (!!).'
|
122
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
123
|
-
Enabled: false
|
124
|
-
|
125
|
-
Style/EachWithObject:
|
126
|
-
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
127
|
-
Enabled: false
|
128
|
-
|
129
|
-
Style/EmptyLiteral:
|
130
|
-
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
131
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
132
|
-
Enabled: false
|
133
|
-
|
134
|
-
# Checks whether the source file has a utf-8 encoding comment or not
|
135
|
-
# AutoCorrectEncodingComment must match the regex
|
136
|
-
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
137
|
-
Style/Encoding:
|
138
|
-
Enabled: false
|
139
|
-
|
140
|
-
Style/EvenOdd:
|
141
|
-
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
142
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
143
|
-
Enabled: false
|
144
|
-
|
145
|
-
Naming/FileName:
|
146
|
-
Description: 'Use snake_case for source file names.'
|
147
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
148
|
-
Enabled: false
|
149
|
-
|
150
|
-
Style/FrozenStringLiteralComment:
|
151
|
-
Description: >-
|
152
|
-
Add the frozen_string_literal comment to the top of files
|
153
|
-
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
154
|
-
Enabled: false
|
155
|
-
|
156
|
-
Style/FlipFlop:
|
157
|
-
Description: 'Checks for flip flops'
|
158
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
159
|
-
Enabled: false
|
160
|
-
|
161
|
-
Style/FormatString:
|
162
|
-
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
163
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
164
|
-
Enabled: false
|
165
|
-
|
166
|
-
Style/GlobalVars:
|
167
|
-
Description: 'Do not introduce global variables.'
|
168
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
169
|
-
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
170
|
-
Enabled: false
|
171
|
-
|
172
|
-
Style/GuardClause:
|
173
|
-
Description: 'Check for conditionals that can be replaced with guard clauses'
|
174
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
175
|
-
Enabled: false
|
176
|
-
|
177
|
-
Style/IfUnlessModifier:
|
178
|
-
Description: >-
|
179
|
-
Favor modifier if/unless usage when you have a
|
180
|
-
single-line body.
|
181
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
182
|
-
Enabled: false
|
183
|
-
|
184
|
-
Style/IfWithSemicolon:
|
185
|
-
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
186
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
187
|
-
Enabled: false
|
188
|
-
|
189
|
-
Style/InlineComment:
|
190
|
-
Description: 'Avoid inline comments.'
|
191
|
-
Enabled: false
|
192
|
-
|
193
|
-
Style/Lambda:
|
194
|
-
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
195
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
196
|
-
Enabled: false
|
197
|
-
|
198
|
-
Style/LambdaCall:
|
199
|
-
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
200
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
201
|
-
Enabled: false
|
202
|
-
|
203
|
-
Style/LineEndConcatenation:
|
204
|
-
Description: >-
|
205
|
-
Use \ instead of + or << to concatenate two string literals at
|
206
|
-
line end.
|
207
|
-
Enabled: false
|
208
|
-
|
209
|
-
Style/SymbolArray:
|
210
|
-
Enabled: true
|
211
|
-
EnforcedStyle: brackets
|
212
|
-
|
213
|
-
Style/DateTime:
|
214
|
-
Enabled: false
|
215
|
-
|
216
|
-
Metrics/LineLength:
|
217
|
-
Description: 'Limit lines to 120 characters.'
|
218
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
219
|
-
Max: 120
|
16
|
+
Max: 235
|
220
17
|
|
18
|
+
# Offense count: 7
|
19
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
|
221
20
|
Metrics/MethodLength:
|
222
|
-
|
223
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
224
|
-
Enabled: false
|
225
|
-
|
226
|
-
Style/ModuleFunction:
|
227
|
-
Description: 'Checks for usage of `extend self` in modules.'
|
228
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
229
|
-
Enabled: false
|
230
|
-
|
231
|
-
Style/MultilineBlockChain:
|
232
|
-
Description: 'Avoid multi-line chains of blocks.'
|
233
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
234
|
-
Enabled: false
|
235
|
-
|
236
|
-
Style/NegatedIf:
|
237
|
-
Description: >-
|
238
|
-
Favor unless over if for negative conditions
|
239
|
-
(or control flow or).
|
240
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
241
|
-
Enabled: false
|
242
|
-
|
243
|
-
Style/NegatedWhile:
|
244
|
-
Description: 'Favor until over while for negative conditions.'
|
245
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
246
|
-
Enabled: false
|
247
|
-
|
248
|
-
Style/Next:
|
249
|
-
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
250
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
251
|
-
Enabled: false
|
252
|
-
|
253
|
-
Style/NilComparison:
|
254
|
-
Description: 'Prefer x.nil? to x == nil.'
|
255
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
256
|
-
Enabled: false
|
257
|
-
|
258
|
-
Style/Not:
|
259
|
-
Description: 'Use ! instead of not.'
|
260
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
261
|
-
Enabled: false
|
262
|
-
|
263
|
-
Style/NumericLiterals:
|
264
|
-
Description: >-
|
265
|
-
Add underscores to large numeric literals to improve their
|
266
|
-
readability.
|
267
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
268
|
-
Enabled: false
|
269
|
-
|
270
|
-
Style/OneLineConditional:
|
271
|
-
Description: >-
|
272
|
-
Favor the ternary operator(?:) over
|
273
|
-
if/then/else/end constructs.
|
274
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
275
|
-
Enabled: false
|
276
|
-
|
277
|
-
Naming/BinaryOperatorParameterName:
|
278
|
-
Description: 'When defining binary operators, name the argument other.'
|
279
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
280
|
-
Enabled: false
|
281
|
-
|
282
|
-
Metrics/ParameterLists:
|
283
|
-
Description: 'Avoid parameter lists longer than three or four parameters.'
|
284
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
285
|
-
Enabled: false
|
286
|
-
|
287
|
-
Style/PercentLiteralDelimiters:
|
288
|
-
Description: 'Use `%`-literal delimiters consistently'
|
289
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
290
|
-
Enabled: false
|
291
|
-
|
292
|
-
Style/PerlBackrefs:
|
293
|
-
Description: 'Avoid Perl-style regex back references.'
|
294
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
295
|
-
Enabled: false
|
21
|
+
Max: 25
|
296
22
|
|
297
|
-
|
298
|
-
Description: 'Check the names of predicate methods.'
|
299
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
300
|
-
NamePrefixBlacklist:
|
301
|
-
- is_
|
23
|
+
Layout/LineLength:
|
302
24
|
Exclude:
|
303
|
-
- spec
|
304
|
-
|
305
|
-
Style/Proc:
|
306
|
-
Description: 'Use proc instead of Proc.new.'
|
307
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
308
|
-
Enabled: false
|
25
|
+
- 'spec/**/*.rb'
|
309
26
|
|
310
|
-
Style/
|
311
|
-
Description: 'Checks the arguments passed to raise/fail.'
|
312
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
313
|
-
Enabled: false
|
314
|
-
|
315
|
-
Style/RegexpLiteral:
|
316
|
-
Description: 'Use / or %r around regular expressions.'
|
317
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
318
|
-
Enabled: false
|
319
|
-
|
320
|
-
Style/SelfAssignment:
|
321
|
-
Description: >-
|
322
|
-
Checks for places where self-assignment shorthand should have
|
323
|
-
been used.
|
324
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
325
|
-
Enabled: false
|
326
|
-
|
327
|
-
Style/SingleLineBlockParams:
|
328
|
-
Description: 'Enforces the names of some block params.'
|
329
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
330
|
-
Enabled: false
|
331
|
-
|
332
|
-
Style/SingleLineMethods:
|
333
|
-
Description: 'Avoid single-line methods.'
|
334
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
335
|
-
Enabled: false
|
336
|
-
|
337
|
-
Style/SignalException:
|
338
|
-
Description: 'Checks for proper usage of fail and raise.'
|
339
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
27
|
+
Style/AsciiComments:
|
340
28
|
Enabled: false
|
341
29
|
|
342
|
-
Style/
|
343
|
-
Description: 'Avoid Perl-style global variables.'
|
344
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
30
|
+
Style/IfUnlessModifier:
|
345
31
|
Enabled: false
|
346
32
|
|
347
33
|
Style/StringLiterals:
|
348
|
-
Description: 'Checks if uses of quotes match the configured preference.'
|
349
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
350
34
|
EnforcedStyle: double_quotes
|
351
|
-
Enabled: true
|
352
|
-
|
353
|
-
Style/TrailingCommaInArguments:
|
354
|
-
Description: 'Checks for trailing comma in argument lists.'
|
355
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
356
|
-
EnforcedStyleForMultiline: comma
|
357
|
-
SupportedStylesForMultiline:
|
358
|
-
- comma
|
359
|
-
- consistent_comma
|
360
|
-
- no_comma
|
361
|
-
Enabled: true
|
362
|
-
|
363
|
-
Style/TrailingCommaInLiteral:
|
364
|
-
Description: 'Checks for trailing comma in array and hash literals.'
|
365
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
366
|
-
EnforcedStyleForMultiline: comma
|
367
|
-
SupportedStylesForMultiline:
|
368
|
-
- comma
|
369
|
-
- consistent_comma
|
370
|
-
- no_comma
|
371
|
-
Enabled: true
|
372
|
-
|
373
|
-
Style/TrivialAccessors:
|
374
|
-
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
375
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
376
|
-
Enabled: false
|
377
|
-
|
378
|
-
Style/VariableInterpolation:
|
379
|
-
Description: >-
|
380
|
-
Don't interpolate global, instance and class variables
|
381
|
-
directly in strings.
|
382
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
383
|
-
Enabled: false
|
384
|
-
|
385
|
-
Style/WhenThen:
|
386
|
-
Description: 'Use when x then ... for one-line cases.'
|
387
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
388
|
-
Enabled: false
|
389
|
-
|
390
|
-
Style/WhileUntilModifier:
|
391
|
-
Description: >-
|
392
|
-
Favor modifier while/until usage when you have a
|
393
|
-
single-line body.
|
394
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
395
|
-
Enabled: false
|
396
|
-
|
397
|
-
Style/WordArray:
|
398
|
-
Description: 'Use %w or %W for arrays of words.'
|
399
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
400
|
-
Enabled: false
|
401
|
-
|
402
|
-
# Layout
|
403
|
-
|
404
|
-
Layout/AlignParameters:
|
405
|
-
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
|
406
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
407
|
-
Enabled: false
|
408
|
-
|
409
|
-
Layout/DotPosition:
|
410
|
-
Description: 'Checks the position of the dot in multi-line method calls.'
|
411
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
412
|
-
EnforcedStyle: trailing
|
413
|
-
|
414
|
-
Layout/ExtraSpacing:
|
415
|
-
Description: 'Do not use unnecessary spacing.'
|
416
|
-
Enabled: true
|
417
|
-
|
418
|
-
Layout/MultilineOperationIndentation:
|
419
|
-
Description: >-
|
420
|
-
Checks indentation of binary operations that span more than
|
421
|
-
one line.
|
422
|
-
Enabled: true
|
423
|
-
EnforcedStyle: indented
|
424
|
-
|
425
|
-
Layout/MultilineMethodCallIndentation:
|
426
|
-
Description: >-
|
427
|
-
Checks indentation of method calls with the dot operator
|
428
|
-
that span more than one line.
|
429
|
-
Enabled: true
|
430
|
-
EnforcedStyle: indented
|
431
|
-
|
432
|
-
Layout/InitialIndentation:
|
433
|
-
Description: >-
|
434
|
-
Checks the indentation of the first non-blank non-comment line in a file.
|
435
|
-
Enabled: false
|
436
|
-
|
437
|
-
# Lint
|
438
|
-
|
439
|
-
Lint/AmbiguousOperator:
|
440
|
-
Description: >-
|
441
|
-
Checks for ambiguous operators in the first argument of a
|
442
|
-
method invocation without parentheses.
|
443
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
444
|
-
Enabled: false
|
445
|
-
|
446
|
-
Lint/AmbiguousRegexpLiteral:
|
447
|
-
Description: >-
|
448
|
-
Checks for ambiguous regexp literals in the first argument of
|
449
|
-
a method invocation without parenthesis.
|
450
|
-
Enabled: false
|
451
|
-
|
452
|
-
Lint/AssignmentInCondition:
|
453
|
-
Description: "Don't use assignment in conditions."
|
454
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
455
|
-
Enabled: false
|
456
|
-
|
457
|
-
Lint/CircularArgumentReference:
|
458
|
-
Description: "Don't refer to the keyword argument in the default value."
|
459
|
-
Enabled: false
|
460
|
-
|
461
|
-
Lint/ConditionPosition:
|
462
|
-
Description: >-
|
463
|
-
Checks for condition placed in a confusing position relative to
|
464
|
-
the keyword.
|
465
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
466
|
-
Enabled: false
|
467
|
-
|
468
|
-
Lint/DeprecatedClassMethods:
|
469
|
-
Description: 'Check for deprecated class method calls.'
|
470
|
-
Enabled: false
|
471
|
-
|
472
|
-
Lint/DuplicatedKey:
|
473
|
-
Description: 'Check for duplicate keys in hash literals.'
|
474
|
-
Enabled: false
|
475
|
-
|
476
|
-
Lint/EachWithObjectArgument:
|
477
|
-
Description: 'Check for immutable argument given to each_with_object.'
|
478
|
-
Enabled: false
|
479
|
-
|
480
|
-
Lint/ElseLayout:
|
481
|
-
Description: 'Check for odd code arrangement in an else block.'
|
482
|
-
Enabled: false
|
483
|
-
|
484
|
-
Lint/FormatParameterMismatch:
|
485
|
-
Description: 'The number of parameters to format/sprint must match the fields.'
|
486
|
-
Enabled: false
|
487
|
-
|
488
|
-
Lint/HandleExceptions:
|
489
|
-
Description: "Don't suppress exception."
|
490
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
491
|
-
Enabled: false
|
492
|
-
|
493
|
-
Lint/LiteralInInterpolation:
|
494
|
-
Description: 'Checks for literals used in interpolation.'
|
495
|
-
Enabled: false
|
496
|
-
|
497
|
-
Lint/Loop:
|
498
|
-
Description: >-
|
499
|
-
Use Kernel#loop with break rather than begin/end/until or
|
500
|
-
begin/end/while for post-loop tests.
|
501
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
502
|
-
Enabled: false
|
503
|
-
|
504
|
-
Lint/NestedMethodDefinition:
|
505
|
-
Description: 'Do not use nested method definitions.'
|
506
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
507
|
-
Enabled: false
|
508
|
-
|
509
|
-
Lint/NonLocalExitFromIterator:
|
510
|
-
Description: 'Do not use return in iterator to cause non-local exit.'
|
511
|
-
Enabled: false
|
512
|
-
|
513
|
-
Lint/ParenthesesAsGroupedExpression:
|
514
|
-
Description: >-
|
515
|
-
Checks for method calls with a space before the opening
|
516
|
-
parenthesis.
|
517
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
518
|
-
Enabled: false
|
519
|
-
|
520
|
-
Lint/RequireParentheses:
|
521
|
-
Description: >-
|
522
|
-
Use parentheses in the method call to avoid confusion
|
523
|
-
about precedence.
|
524
|
-
Enabled: false
|
525
|
-
|
526
|
-
Lint/UnderscorePrefixedVariableName:
|
527
|
-
Description: 'Do not use prefix `_` for a variable that is used.'
|
528
|
-
Enabled: false
|
529
|
-
|
530
|
-
Lint/UnneededDisable:
|
531
|
-
Description: >-
|
532
|
-
Checks for rubocop:disable comments that can be removed.
|
533
|
-
Note: this cop is not disabled when disabling all cops.
|
534
|
-
It must be explicitly disabled.
|
535
|
-
Enabled: false
|
536
|
-
|
537
|
-
Lint/Void:
|
538
|
-
Description: 'Possible use of operator/literal/variable in void context.'
|
539
|
-
Enabled: false
|
540
|
-
|
541
|
-
# Performance
|
542
|
-
|
543
|
-
Performance/CaseWhenSplat:
|
544
|
-
Description: >-
|
545
|
-
Place `when` conditions that use splat at the end
|
546
|
-
of the list of `when` branches.
|
547
|
-
Enabled: false
|
548
|
-
|
549
|
-
Performance/Count:
|
550
|
-
Description: >-
|
551
|
-
Use `count` instead of `select...size`, `reject...size`,
|
552
|
-
`select...count`, `reject...count`, `select...length`,
|
553
|
-
and `reject...length`.
|
554
|
-
Enabled: false
|
555
|
-
|
556
|
-
Performance/Detect:
|
557
|
-
Description: >-
|
558
|
-
Use `detect` instead of `select.first`, `find_all.first`,
|
559
|
-
`select.last`, and `find_all.last`.
|
560
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
561
|
-
Enabled: false
|
562
|
-
|
563
|
-
Performance/FlatMap:
|
564
|
-
Description: >-
|
565
|
-
Use `Enumerable#flat_map`
|
566
|
-
instead of `Enumerable#map...Array#flatten(1)`
|
567
|
-
or `Enumberable#collect..Array#flatten(1)`
|
568
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
569
|
-
Enabled: false
|
570
|
-
|
571
|
-
Performance/ReverseEach:
|
572
|
-
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
573
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
574
|
-
Enabled: false
|
575
|
-
|
576
|
-
Performance/Sample:
|
577
|
-
Description: >-
|
578
|
-
Use `sample` instead of `shuffle.first`,
|
579
|
-
`shuffle.last`, and `shuffle[Fixnum]`.
|
580
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
581
|
-
Enabled: false
|
582
|
-
|
583
|
-
Performance/Size:
|
584
|
-
Description: >-
|
585
|
-
Use `size` instead of `count` for counting
|
586
|
-
the number of elements in `Array` and `Hash`.
|
587
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
588
|
-
Enabled: false
|
589
|
-
|
590
|
-
Performance/StringReplacement:
|
591
|
-
Description: >-
|
592
|
-
Use `tr` instead of `gsub` when you are replacing the same
|
593
|
-
number of characters. Use `delete` instead of `gsub` when
|
594
|
-
you are deleting characters.
|
595
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
596
|
-
Enabled: false
|
597
|
-
|
598
|
-
# Rails
|
599
|
-
|
600
|
-
Rails/ActionFilter:
|
601
|
-
Description: 'Enforces consistent use of action filter methods.'
|
602
|
-
Enabled: false
|
603
|
-
|
604
|
-
Rails/Date:
|
605
|
-
Description: >-
|
606
|
-
Checks the correct usage of date aware methods,
|
607
|
-
such as Date.today, Date.current etc.
|
608
|
-
Enabled: false
|
609
|
-
|
610
|
-
Rails/FindBy:
|
611
|
-
Description: 'Prefer find_by over where.first.'
|
612
|
-
Enabled: false
|
613
|
-
|
614
|
-
Rails/FindEach:
|
615
|
-
Description: 'Prefer all.find_each over all.find.'
|
616
|
-
Enabled: false
|
617
|
-
|
618
|
-
Rails/HasAndBelongsToMany:
|
619
|
-
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
620
|
-
Enabled: false
|
621
|
-
|
622
|
-
Rails/Output:
|
623
|
-
Description: 'Checks for calls to puts, print, etc.'
|
624
|
-
Enabled: false
|
625
|
-
|
626
|
-
Rails/ReadWriteAttribute:
|
627
|
-
Description: >-
|
628
|
-
Checks for read_attribute(:attr) and
|
629
|
-
write_attribute(:attr, val).
|
630
|
-
Enabled: false
|
631
|
-
|
632
|
-
Rails/ScopeArgs:
|
633
|
-
Description: 'Checks the arguments of ActiveRecord scopes.'
|
634
|
-
Enabled: false
|
635
|
-
|
636
|
-
Rails/TimeZone:
|
637
|
-
Description: 'Checks the correct usage of time zone aware methods.'
|
638
|
-
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
639
|
-
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
640
|
-
Enabled: false
|
641
|
-
|
642
|
-
Rails/Validation:
|
643
|
-
Description: 'Use validates :attribute, hash of validations.'
|
644
|
-
Enabled: false
|