parxer 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.circleci/config.yml +102 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.rubocop.yml +22 -579
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -1
- data/README.md +9 -14
- data/bin/console +2 -2
- data/lib/parxer.rb +8 -1
- data/lib/parxer/parsers/csv_parser.rb +0 -2
- data/lib/parxer/parsers/xls_parser.rb +0 -2
- data/lib/parxer/version.rb +1 -1
- data/parxer.gemspec +8 -5
- metadata +49 -21
- data/.travis.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b6a27548a85cdc15543c65753f4ede5dadb8638bd3c4e9918c952b1fdeddd7a3
|
4
|
+
data.tar.gz: eaf3dcfd5dfcd30d07c99c8a8c843b032ca27ed47ed5d8abda678dbd35241854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2296d7476bff30e5f2a9746f0802fe497a1e6d3dacc238c00259c4c86e8b2e76a6acefc6fb342d279bcb0ac94b32beefce6208bc21b2a583c7b1afafe1159068
|
7
|
+
data.tar.gz: 5a7909e6edf56d2dc139af02c1b23954eaef311b59a06fedec9ab9fd9f95086833f4061a65cd4ed1514c6ff90bb2827cad53e3d01c80bb3767068516c040b486
|
@@ -0,0 +1,102 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
env-vars: &env-vars
|
4
|
+
RAILS_ENV: test
|
5
|
+
NODE_ENV: test
|
6
|
+
BUNDLE_PATH: vendor/bundle
|
7
|
+
|
8
|
+
orbs:
|
9
|
+
ruby: circleci/ruby@0.1.2
|
10
|
+
browser-tools: circleci/browser-tools@1.1.3
|
11
|
+
|
12
|
+
executors:
|
13
|
+
main-executor:
|
14
|
+
parameters:
|
15
|
+
ruby-version:
|
16
|
+
description: "Ruby version"
|
17
|
+
default: "2.7"
|
18
|
+
type: string
|
19
|
+
docker:
|
20
|
+
- image: circleci/ruby:<<parameters.ruby-version>>-node
|
21
|
+
environment: *env-vars
|
22
|
+
|
23
|
+
commands:
|
24
|
+
setup:
|
25
|
+
description: checkout code and install dependencies
|
26
|
+
steps:
|
27
|
+
- checkout
|
28
|
+
- run:
|
29
|
+
name: Install bundle dependencies
|
30
|
+
command: |
|
31
|
+
gem install bundler:2.2.15
|
32
|
+
bundle install
|
33
|
+
|
34
|
+
jobs:
|
35
|
+
lint:
|
36
|
+
executor: main-executor
|
37
|
+
steps:
|
38
|
+
- setup
|
39
|
+
- run:
|
40
|
+
name: Install reviewdog
|
41
|
+
command: |
|
42
|
+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
|
43
|
+
- run:
|
44
|
+
name: Get files to lint
|
45
|
+
command: |
|
46
|
+
mkdir tmp
|
47
|
+
git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
|
48
|
+
- run:
|
49
|
+
name: Run rubocop
|
50
|
+
shell: /bin/bash
|
51
|
+
command: |
|
52
|
+
cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
|
53
|
+
| ./bin/reviewdog -reporter=github-pr-review -f=rubocop
|
54
|
+
test:
|
55
|
+
parameters:
|
56
|
+
ruby-version:
|
57
|
+
description: "Ruby version"
|
58
|
+
default: "2.7"
|
59
|
+
type: string
|
60
|
+
executor:
|
61
|
+
name: main-executor
|
62
|
+
ruby-version: <<parameters.ruby-version>>
|
63
|
+
steps:
|
64
|
+
- setup
|
65
|
+
- run:
|
66
|
+
name: Run Tests
|
67
|
+
command: |
|
68
|
+
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
|
69
|
+
RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
|
70
|
+
bundle exec rspec ./spec/lib $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
71
|
+
- store_test_results:
|
72
|
+
path: test_results
|
73
|
+
deploy:
|
74
|
+
executor: main-executor
|
75
|
+
steps:
|
76
|
+
- setup
|
77
|
+
- run:
|
78
|
+
name: Setup rubygems
|
79
|
+
command: bash .circleci/setup-rubygems.sh
|
80
|
+
- run:
|
81
|
+
name: Publish to rubygems
|
82
|
+
command: |
|
83
|
+
gem build parxer.gemspec
|
84
|
+
gem push "parxer-$(git describe --tags).gem"
|
85
|
+
|
86
|
+
workflows:
|
87
|
+
version: 2
|
88
|
+
test_and_lint:
|
89
|
+
jobs:
|
90
|
+
- lint:
|
91
|
+
context: org-global
|
92
|
+
- test:
|
93
|
+
matrix:
|
94
|
+
parameters:
|
95
|
+
ruby-version: ["2.5", "2.6", "2.7"]
|
96
|
+
- deploy:
|
97
|
+
context: org-global
|
98
|
+
filters:
|
99
|
+
tags:
|
100
|
+
only: /.*/
|
101
|
+
branches:
|
102
|
+
ignore: /.*/
|
data/.rubocop.yml
CHANGED
@@ -1,34 +1,14 @@
|
|
1
1
|
AllCops:
|
2
|
-
Include:
|
3
|
-
- "**/*.rake"
|
4
|
-
- "**/Gemfile"
|
5
|
-
- "**/Rakefile"
|
6
2
|
Exclude:
|
7
3
|
- "vendor/**/*"
|
8
|
-
- "db
|
4
|
+
- "spec/dummy/db/schema.rb"
|
5
|
+
- "db/schema.rb"
|
9
6
|
- "bin/**/*"
|
7
|
+
- "spec/dummy/db/schema.rb"
|
10
8
|
DisplayCopNames: false
|
11
|
-
|
12
|
-
|
13
|
-
Layout/AccessModifierIndentation:
|
14
|
-
Description: Check indentation of private/protected visibility modifiers.
|
15
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
|
9
|
+
TargetRubyVersion: 2.5
|
10
|
+
Rails:
|
16
11
|
Enabled: true
|
17
|
-
EnforcedStyle: indent
|
18
|
-
SupportedStyles:
|
19
|
-
- outdent
|
20
|
-
- indent
|
21
|
-
Layout/AlignHash:
|
22
|
-
Description: Align the elements of a hash literal if they span more than one line.
|
23
|
-
Enabled: true
|
24
|
-
EnforcedHashRocketStyle: key
|
25
|
-
EnforcedColonStyle: key
|
26
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
27
|
-
SupportedLastArgumentHashStyles:
|
28
|
-
- always_inspect
|
29
|
-
- always_ignore
|
30
|
-
- ignore_implicit
|
31
|
-
- ignore_explicit
|
32
12
|
Layout/AlignParameters:
|
33
13
|
Description: Align the parameters of a method call if they span more than one line.
|
34
14
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
|
@@ -37,41 +17,8 @@ Layout/AlignParameters:
|
|
37
17
|
SupportedStyles:
|
38
18
|
- with_first_parameter
|
39
19
|
- with_fixed_indentation
|
40
|
-
Style/AndOr:
|
41
|
-
Description: Use &&/|| instead of and/or.
|
42
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
|
43
|
-
Enabled: true
|
44
|
-
EnforcedStyle: always
|
45
|
-
SupportedStyles:
|
46
|
-
- always
|
47
|
-
- conditionals
|
48
|
-
Style/BarePercentLiterals:
|
49
|
-
Description: Checks if usage of %() or %Q() matches configuration.
|
50
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
|
51
|
-
Enabled: true
|
52
|
-
EnforcedStyle: bare_percent
|
53
|
-
SupportedStyles:
|
54
|
-
- percent_q
|
55
|
-
- bare_percent
|
56
20
|
Metrics/BlockLength:
|
57
21
|
Enabled: false
|
58
|
-
Style/BracesAroundHashParameters:
|
59
|
-
Description: Enforce braces style around hash parameters.
|
60
|
-
Enabled: true
|
61
|
-
EnforcedStyle: no_braces
|
62
|
-
SupportedStyles:
|
63
|
-
- braces
|
64
|
-
- no_braces
|
65
|
-
- context_dependent
|
66
|
-
Layout/CaseIndentation:
|
67
|
-
Description: Indentation of when in a case/when/[else/]end.
|
68
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
|
69
|
-
Enabled: true
|
70
|
-
EnforcedStyle: case
|
71
|
-
SupportedStyles:
|
72
|
-
- case
|
73
|
-
- end
|
74
|
-
IndentOneStep: false
|
75
22
|
Style/ClassAndModuleChildren:
|
76
23
|
Description: Checks style of children classes and modules.
|
77
24
|
Enabled: false
|
@@ -79,24 +26,6 @@ Style/ClassAndModuleChildren:
|
|
79
26
|
SupportedStyles:
|
80
27
|
- nested
|
81
28
|
- compact
|
82
|
-
Style/ClassCheck:
|
83
|
-
Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
|
84
|
-
Enabled: true
|
85
|
-
EnforcedStyle: is_a?
|
86
|
-
SupportedStyles:
|
87
|
-
- is_a?
|
88
|
-
- kind_of?
|
89
|
-
Style/CollectionMethods:
|
90
|
-
Description: Preferred collection methods.
|
91
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
92
|
-
Enabled: false
|
93
|
-
PreferredMethods:
|
94
|
-
collect: map
|
95
|
-
collect!: map!
|
96
|
-
inject: reduce
|
97
|
-
detect: find
|
98
|
-
find_all: select
|
99
|
-
find: detect
|
100
29
|
Style/CommentAnnotation:
|
101
30
|
Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
|
102
31
|
REVIEW).
|
@@ -108,69 +37,11 @@ Style/CommentAnnotation:
|
|
108
37
|
- OPTIMIZE
|
109
38
|
- HACK
|
110
39
|
- REVIEW
|
111
|
-
|
112
|
-
Description: Checks the position of the dot in multi-line method calls.
|
113
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
114
|
-
Enabled: true
|
115
|
-
EnforcedStyle: leading
|
116
|
-
SupportedStyles:
|
117
|
-
- leading
|
118
|
-
- trailing
|
119
|
-
Layout/EmptyLineBetweenDefs:
|
120
|
-
Description: Use empty lines between defs.
|
121
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
|
122
|
-
Enabled: true
|
123
|
-
AllowAdjacentOneLineDefs: false
|
124
|
-
Layout/EmptyLinesAroundBlockBody:
|
125
|
-
Description: Keeps track of empty lines around block bodies.
|
126
|
-
Enabled: true
|
127
|
-
EnforcedStyle: no_empty_lines
|
128
|
-
SupportedStyles:
|
129
|
-
- empty_lines
|
130
|
-
- no_empty_lines
|
131
|
-
Layout/EmptyLinesAroundClassBody:
|
132
|
-
Description: Keeps track of empty lines around class bodies.
|
133
|
-
Enabled: true
|
134
|
-
EnforcedStyle: no_empty_lines
|
135
|
-
SupportedStyles:
|
136
|
-
- empty_lines
|
137
|
-
- no_empty_lines
|
138
|
-
Layout/EmptyLinesAroundModuleBody:
|
139
|
-
Description: Keeps track of empty lines around module bodies.
|
140
|
-
Enabled: true
|
141
|
-
EnforcedStyle: no_empty_lines
|
142
|
-
SupportedStyles:
|
143
|
-
- empty_lines
|
144
|
-
- no_empty_lines
|
145
|
-
Style/Encoding:
|
146
|
-
Description: Use UTF-8 as the source file encoding.
|
147
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
|
148
|
-
Enabled: false
|
149
|
-
EnforcedStyle: always
|
150
|
-
SupportedStyles:
|
151
|
-
- when_needed
|
152
|
-
- always
|
153
|
-
Style/FileName:
|
40
|
+
Naming/FileName:
|
154
41
|
Description: Use snake_case for source file names.
|
155
42
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
156
43
|
Enabled: false
|
157
44
|
Exclude: []
|
158
|
-
Layout/FirstParameterIndentation:
|
159
|
-
Description: Checks the indentation of the first parameter in a method call.
|
160
|
-
Enabled: true
|
161
|
-
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
162
|
-
SupportedStyles:
|
163
|
-
- consistent
|
164
|
-
- special_for_inner_method_call
|
165
|
-
- special_for_inner_method_call_in_parentheses
|
166
|
-
Style/For:
|
167
|
-
Description: Checks use of for or each in multiline loops.
|
168
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
|
169
|
-
Enabled: true
|
170
|
-
EnforcedStyle: each
|
171
|
-
SupportedStyles:
|
172
|
-
- for
|
173
|
-
- each
|
174
45
|
Style/FormatString:
|
175
46
|
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
176
47
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
|
@@ -192,32 +63,10 @@ Style/GuardClause:
|
|
192
63
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
193
64
|
Enabled: false
|
194
65
|
MinBodyLength: 1
|
195
|
-
Style/HashSyntax:
|
196
|
-
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
|
197
|
-
1, :b => 2 }.'
|
198
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
|
199
|
-
Enabled: true
|
200
|
-
EnforcedStyle: ruby19
|
201
|
-
SupportedStyles:
|
202
|
-
- ruby19
|
203
|
-
- hash_rockets
|
204
66
|
Style/IfUnlessModifier:
|
205
67
|
Description: Favor modifier if/unless usage when you have a single-line body.
|
206
68
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
207
69
|
Enabled: false
|
208
|
-
MaxLineLength: 80
|
209
|
-
Layout/IndentationWidth:
|
210
|
-
Description: Use 2 spaces for indentation.
|
211
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
212
|
-
Enabled: true
|
213
|
-
Width: 2
|
214
|
-
Layout/IndentHash:
|
215
|
-
Description: Checks the indentation of the first key in a hash literal.
|
216
|
-
Enabled: true
|
217
|
-
EnforcedStyle: special_inside_parentheses
|
218
|
-
SupportedStyles:
|
219
|
-
- special_inside_parentheses
|
220
|
-
- consistent
|
221
70
|
Style/LambdaCall:
|
222
71
|
Description: Use lambda.call(...) instead of lambda.(...).
|
223
72
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
|
@@ -235,27 +84,6 @@ Style/Next:
|
|
235
84
|
SupportedStyles:
|
236
85
|
- skip_modifier_ifs
|
237
86
|
- always
|
238
|
-
Style/NonNilCheck:
|
239
|
-
Description: Checks for redundant nil checks.
|
240
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
|
241
|
-
Enabled: true
|
242
|
-
IncludeSemanticChanges: false
|
243
|
-
Style/MethodDefParentheses:
|
244
|
-
Description: Checks if the method definitions have or don't have parentheses.
|
245
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
246
|
-
Enabled: true
|
247
|
-
EnforcedStyle: require_parentheses
|
248
|
-
SupportedStyles:
|
249
|
-
- require_parentheses
|
250
|
-
- require_no_parentheses
|
251
|
-
Style/MethodName:
|
252
|
-
Description: Use the configured style when naming methods.
|
253
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
254
|
-
Enabled: true
|
255
|
-
EnforcedStyle: snake_case
|
256
|
-
SupportedStyles:
|
257
|
-
- snake_case
|
258
|
-
- camelCase
|
259
87
|
Layout/MultilineOperationIndentation:
|
260
88
|
Description: Checks indentation of binary operations that span more than one line.
|
261
89
|
Enabled: true
|
@@ -271,11 +99,6 @@ Style/NumericLiterals:
|
|
271
99
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
|
272
100
|
Enabled: false
|
273
101
|
MinDigits: 5
|
274
|
-
Style/ParenthesesAroundCondition:
|
275
|
-
Description: Don't use parentheses around the condition of an if/unless/while.
|
276
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
|
277
|
-
Enabled: true
|
278
|
-
AllowSafeAssignment: true
|
279
102
|
Style/PercentLiteralDelimiters:
|
280
103
|
Description: Use `%`-literal delimiters consistently
|
281
104
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
@@ -290,14 +113,7 @@ Style/PercentLiteralDelimiters:
|
|
290
113
|
"%w": "()"
|
291
114
|
"%W": "()"
|
292
115
|
"%x": "()"
|
293
|
-
|
294
|
-
Description: Checks if uses of %Q/%q match the configured preference.
|
295
|
-
Enabled: true
|
296
|
-
EnforcedStyle: lower_case_q
|
297
|
-
SupportedStyles:
|
298
|
-
- lower_case_q
|
299
|
-
- upper_case_q
|
300
|
-
Style/PredicateName:
|
116
|
+
Naming/PredicateName:
|
301
117
|
Description: Check the names of predicate methods.
|
302
118
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
303
119
|
Enabled: true
|
@@ -315,16 +131,6 @@ Style/RaiseArgs:
|
|
315
131
|
SupportedStyles:
|
316
132
|
- compact
|
317
133
|
- exploded
|
318
|
-
Style/RedundantReturn:
|
319
|
-
Description: Don't use return where it's not required.
|
320
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
|
321
|
-
Enabled: true
|
322
|
-
AllowMultipleReturnValues: false
|
323
|
-
Style/Semicolon:
|
324
|
-
Description: Don't use semicolons to terminate expressions.
|
325
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
|
326
|
-
Enabled: true
|
327
|
-
AllowAsExpressionSeparator: false
|
328
134
|
Style/SignalException:
|
329
135
|
Description: Checks for proper usage of fail and raise.
|
330
136
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
@@ -334,17 +140,6 @@ Style/SignalException:
|
|
334
140
|
- only_raise
|
335
141
|
- only_fail
|
336
142
|
- semantic
|
337
|
-
Style/SingleLineBlockParams:
|
338
|
-
Description: Enforces the names of some block params.
|
339
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
340
|
-
Enabled: false
|
341
|
-
Methods:
|
342
|
-
- reduce:
|
343
|
-
- a
|
344
|
-
- e
|
345
|
-
- inject:
|
346
|
-
- a
|
347
|
-
- e
|
348
143
|
Style/SingleLineMethods:
|
349
144
|
Description: Avoid single-line methods.
|
350
145
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
@@ -358,77 +153,17 @@ Style/StringLiterals:
|
|
358
153
|
SupportedStyles:
|
359
154
|
- single_quotes
|
360
155
|
- double_quotes
|
361
|
-
Style/StringLiteralsInInterpolation:
|
362
|
-
Description: Checks if uses of quotes inside expressions in interpolated strings
|
363
|
-
match the configured preference.
|
364
|
-
Enabled: true
|
365
|
-
EnforcedStyle: single_quotes
|
366
|
-
SupportedStyles:
|
367
|
-
- single_quotes
|
368
|
-
- double_quotes
|
369
|
-
Layout/SpaceAroundBlockParameters:
|
370
|
-
Description: Checks the spacing inside and after block parameters pipes.
|
371
|
-
Enabled: true
|
372
|
-
EnforcedStyleInsidePipes: no_space
|
373
|
-
SupportedStylesInsidePipes:
|
374
|
-
- space
|
375
|
-
- no_space
|
376
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
377
|
-
Description: Checks that the equals signs in parameter default assignments have
|
378
|
-
or don't have surrounding space depending on configuration.
|
379
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
|
380
|
-
Enabled: true
|
381
|
-
EnforcedStyle: space
|
382
|
-
SupportedStyles:
|
383
|
-
- space
|
384
|
-
- no_space
|
385
|
-
Layout/SpaceBeforeBlockBraces:
|
386
|
-
Description: Checks that the left block brace has or doesn't have space before it.
|
387
|
-
Enabled: true
|
388
|
-
EnforcedStyle: space
|
389
|
-
SupportedStyles:
|
390
|
-
- space
|
391
|
-
- no_space
|
392
|
-
Layout/SpaceInsideBlockBraces:
|
393
|
-
Description: Checks that block braces have or don't have surrounding space. For
|
394
|
-
blocks taking parameters, checks that the left brace has or doesn't have trailing
|
395
|
-
space.
|
396
|
-
Enabled: true
|
397
|
-
EnforcedStyle: space
|
398
|
-
SupportedStyles:
|
399
|
-
- space
|
400
|
-
- no_space
|
401
|
-
EnforcedStyleForEmptyBraces: no_space
|
402
|
-
SpaceBeforeBlockParameters: true
|
403
|
-
Layout/SpaceInsideHashLiteralBraces:
|
404
|
-
Description: Use spaces inside hash literal braces - or don't.
|
405
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
406
|
-
Enabled: true
|
407
|
-
EnforcedStyle: space
|
408
|
-
EnforcedStyleForEmptyBraces: no_space
|
409
|
-
SupportedStyles:
|
410
|
-
- space
|
411
|
-
- no_space
|
412
|
-
Style/SymbolProc:
|
413
|
-
Description: Use symbols as procs instead of blocks when possible.
|
414
|
-
Enabled: true
|
415
|
-
IgnoredMethods:
|
416
|
-
- respond_to
|
417
|
-
Layout/TrailingBlankLines:
|
418
|
-
Description: Checks trailing blank lines and final newline.
|
419
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
|
420
|
-
Enabled: true
|
421
|
-
EnforcedStyle: final_newline
|
422
|
-
SupportedStyles:
|
423
|
-
- final_newline
|
424
|
-
- final_blank_line
|
425
156
|
Style/TrailingCommaInArguments:
|
426
157
|
Description: Checks for trailing comma in argument lists.
|
427
158
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
428
159
|
Enabled: true
|
429
|
-
Style/
|
160
|
+
Style/TrailingCommaInArrayLiteral:
|
430
161
|
Description: Checks for trailing comma in array and hash literals.
|
431
|
-
StyleGuide: https://github.com/
|
162
|
+
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
|
163
|
+
Enabled: true
|
164
|
+
Style/TrailingCommaInHashLiteral:
|
165
|
+
Description: Checks for trailing comma in array and hash literals.
|
166
|
+
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
|
432
167
|
Enabled: true
|
433
168
|
Style/TrivialAccessors:
|
434
169
|
Description: Prefer attr_* methods to trivial readers/writers.
|
@@ -455,19 +190,10 @@ Style/TrivialAccessors:
|
|
455
190
|
- to_str
|
456
191
|
- to_s
|
457
192
|
- to_sym
|
458
|
-
Style/VariableName:
|
459
|
-
Description: Use the configured style when naming variables.
|
460
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
461
|
-
Enabled: true
|
462
|
-
EnforcedStyle: snake_case
|
463
|
-
SupportedStyles:
|
464
|
-
- snake_case
|
465
|
-
- camelCase
|
466
193
|
Style/WhileUntilModifier:
|
467
194
|
Description: Favor modifier while/until usage when you have a single-line body.
|
468
195
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
|
469
196
|
Enabled: false
|
470
|
-
MaxLineLength: 80
|
471
197
|
Style/WordArray:
|
472
198
|
Description: Use %w or %W for arrays of words.
|
473
199
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
|
@@ -489,11 +215,6 @@ Metrics/ClassLength:
|
|
489
215
|
Enabled: false
|
490
216
|
CountComments: false
|
491
217
|
Max: 100
|
492
|
-
Metrics/CyclomaticComplexity:
|
493
|
-
Description: A complexity metric that is strongly correlated to the number of test
|
494
|
-
cases needed to validate a method.
|
495
|
-
Enabled: true
|
496
|
-
Max: 6
|
497
218
|
Metrics/LineLength:
|
498
219
|
Description: Limit lines to 100 characters.
|
499
220
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
|
@@ -517,74 +238,25 @@ Metrics/ParameterLists:
|
|
517
238
|
Enabled: false
|
518
239
|
Max: 5
|
519
240
|
CountKeywordArgs: true
|
520
|
-
Metrics/PerceivedComplexity:
|
521
|
-
Description: A complexity metric geared towards measuring complexity for a human
|
522
|
-
reader.
|
523
|
-
Enabled: true
|
524
|
-
Max: 7
|
525
241
|
Lint/AssignmentInCondition:
|
526
242
|
Description: Don't use assignment in conditions.
|
527
243
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
528
244
|
Enabled: false
|
529
245
|
AllowSafeAssignment: true
|
530
|
-
|
246
|
+
Layout/EndAlignment:
|
531
247
|
Description: Align ends correctly.
|
532
248
|
Enabled: true
|
533
249
|
EnforcedStyleAlignWith: keyword
|
534
250
|
SupportedStylesAlignWith:
|
535
251
|
- keyword
|
536
252
|
- variable
|
537
|
-
|
253
|
+
Layout/DefEndAlignment:
|
538
254
|
Description: Align ends corresponding to defs correctly.
|
539
255
|
Enabled: true
|
540
256
|
EnforcedStyleAlignWith: start_of_line
|
541
257
|
SupportedStylesAlignWith:
|
542
258
|
- start_of_line
|
543
259
|
- def
|
544
|
-
Rails/ActionFilter:
|
545
|
-
Description: Enforces consistent use of action filter methods.
|
546
|
-
Enabled: true
|
547
|
-
EnforcedStyle: action
|
548
|
-
SupportedStyles:
|
549
|
-
- action
|
550
|
-
- filter
|
551
|
-
Include:
|
552
|
-
- app/controllers/**/*.rb
|
553
|
-
Rails/HasAndBelongsToMany:
|
554
|
-
Description: Prefer has_many :through to has_and_belongs_to_many.
|
555
|
-
Enabled: true
|
556
|
-
Include:
|
557
|
-
- app/models/**/*.rb
|
558
|
-
Rails/Output:
|
559
|
-
Description: Checks for calls to puts, print, etc.
|
560
|
-
Enabled: true
|
561
|
-
Include:
|
562
|
-
- app/**/*.rb
|
563
|
-
- config/**/*.rb
|
564
|
-
- db/**/*.rb
|
565
|
-
- lib/**/*.rb
|
566
|
-
Rails/ReadWriteAttribute:
|
567
|
-
Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
|
568
|
-
Enabled: true
|
569
|
-
Include:
|
570
|
-
- app/models/**/*.rb
|
571
|
-
Rails/ScopeArgs:
|
572
|
-
Description: Checks the arguments of ActiveRecord scopes.
|
573
|
-
Enabled: true
|
574
|
-
Include:
|
575
|
-
- app/models/**/*.rb
|
576
|
-
Rails/Validation:
|
577
|
-
Description: Use validates :attribute, hash of validations.
|
578
|
-
Enabled: true
|
579
|
-
Include:
|
580
|
-
- app/models/**/*.rb
|
581
|
-
Style/InlineComment:
|
582
|
-
Description: Avoid inline comments.
|
583
|
-
Enabled: false
|
584
|
-
Style/MethodCalledOnDoEndBlock:
|
585
|
-
Description: Avoid chaining a method call on a do...end block.
|
586
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
587
|
-
Enabled: false
|
588
260
|
Style/SymbolArray:
|
589
261
|
Description: Use %i or %I for arrays of symbols.
|
590
262
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
|
@@ -592,17 +264,13 @@ Style/SymbolArray:
|
|
592
264
|
Layout/ExtraSpacing:
|
593
265
|
Description: Do not use unnecessary spacing.
|
594
266
|
Enabled: false
|
595
|
-
|
267
|
+
Naming/AccessorMethodName:
|
596
268
|
Description: Check the naming of accessor methods for get_/set_.
|
597
269
|
Enabled: false
|
598
270
|
Style/Alias:
|
599
271
|
Description: Use alias_method instead of alias.
|
600
272
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
601
273
|
Enabled: false
|
602
|
-
Layout/AlignArray:
|
603
|
-
Description: Align the elements of an array literal if they span more than one line.
|
604
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
|
605
|
-
Enabled: true
|
606
274
|
Style/ArrayJoin:
|
607
275
|
Description: Use Array#join instead of Array#*.
|
608
276
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
|
@@ -611,7 +279,7 @@ Style/AsciiComments:
|
|
611
279
|
Description: Use only ascii symbols in comments.
|
612
280
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
|
613
281
|
Enabled: false
|
614
|
-
|
282
|
+
Naming/AsciiIdentifiers:
|
615
283
|
Description: Use only ascii symbols in identifiers.
|
616
284
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
617
285
|
Enabled: false
|
@@ -619,17 +287,10 @@ Style/Attr:
|
|
619
287
|
Description: Checks for uses of Module#attr.
|
620
288
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
|
621
289
|
Enabled: false
|
622
|
-
Style/BeginBlock:
|
623
|
-
Description: Avoid the use of BEGIN blocks.
|
624
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
|
625
|
-
Enabled: true
|
626
290
|
Style/BlockComments:
|
627
291
|
Description: Do not use block comments.
|
628
292
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
|
629
293
|
Enabled: false
|
630
|
-
Layout/BlockEndNewline:
|
631
|
-
Description: Put end statement of multiline block on its own line.
|
632
|
-
Enabled: true
|
633
294
|
Style/CaseEquality:
|
634
295
|
Description: Avoid explicit use of the case equality operator(===).
|
635
296
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
|
@@ -638,14 +299,6 @@ Style/CharacterLiteral:
|
|
638
299
|
Description: Checks for uses of character literals.
|
639
300
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
|
640
301
|
Enabled: false
|
641
|
-
Style/ClassAndModuleCamelCase:
|
642
|
-
Description: Use CamelCase for classes and modules.
|
643
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
644
|
-
Enabled: true
|
645
|
-
Style/ClassMethods:
|
646
|
-
Description: Use self when defining module/class methods.
|
647
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
|
648
|
-
Enabled: true
|
649
302
|
Style/ClassVars:
|
650
303
|
Description: Avoid the use of class variables.
|
651
304
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
|
@@ -654,17 +307,6 @@ Style/ColonMethodCall:
|
|
654
307
|
Description: 'Do not use :: for method call.'
|
655
308
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
|
656
309
|
Enabled: false
|
657
|
-
Layout/CommentIndentation:
|
658
|
-
Description: Indentation of comments.
|
659
|
-
Enabled: true
|
660
|
-
Style/ConstantName:
|
661
|
-
Description: Constants should use SCREAMING_SNAKE_CASE.
|
662
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
|
663
|
-
Enabled: true
|
664
|
-
Style/DefWithParentheses:
|
665
|
-
Description: Use def with parentheses when there are arguments.
|
666
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
667
|
-
Enabled: true
|
668
310
|
Style/PreferredHashMethods:
|
669
311
|
Description: Checks for use of deprecated Hash methods.
|
670
312
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
|
@@ -679,29 +321,13 @@ Style/DoubleNegation:
|
|
679
321
|
Style/EachWithObject:
|
680
322
|
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
681
323
|
Enabled: false
|
682
|
-
Layout/ElseAlignment:
|
683
|
-
Description: Align elses and elsifs correctly.
|
684
|
-
Enabled: true
|
685
324
|
Style/EmptyElse:
|
686
325
|
Description: Avoid empty else-clauses.
|
687
326
|
Enabled: true
|
688
|
-
Layout/EmptyLines:
|
689
|
-
Description: Don't use several empty lines in a row.
|
690
|
-
Enabled: true
|
691
|
-
Layout/EmptyLinesAroundAccessModifier:
|
692
|
-
Description: Keep blank lines around access modifiers.
|
693
|
-
Enabled: true
|
694
|
-
Layout/EmptyLinesAroundMethodBody:
|
695
|
-
Description: Keeps track of empty lines around method bodies.
|
696
|
-
Enabled: true
|
697
327
|
Style/EmptyLiteral:
|
698
328
|
Description: Prefer literals to Array.new/Hash.new/String.new.
|
699
329
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
700
330
|
Enabled: false
|
701
|
-
Style/EndBlock:
|
702
|
-
Description: Avoid the use of END blocks.
|
703
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
|
704
|
-
Enabled: true
|
705
331
|
Layout/EndOfLine:
|
706
332
|
Description: Use Unix-style line endings.
|
707
333
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
|
@@ -710,7 +336,7 @@ Style/EvenOdd:
|
|
710
336
|
Description: Favor the use of Fixnum#even? && Fixnum#odd?
|
711
337
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
712
338
|
Enabled: false
|
713
|
-
|
339
|
+
Lint/FlipFlop:
|
714
340
|
Description: Checks for flip flops
|
715
341
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
|
716
342
|
Enabled: false
|
@@ -718,32 +344,14 @@ Style/IfWithSemicolon:
|
|
718
344
|
Description: Do not use if x; .... Use the ternary operator instead.
|
719
345
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
|
720
346
|
Enabled: false
|
721
|
-
Layout/IndentationConsistency:
|
722
|
-
Description: Keep indentation straight.
|
723
|
-
Enabled: true
|
724
|
-
Layout/IndentArray:
|
725
|
-
Description: Checks the indentation of the first element in an array literal.
|
726
|
-
Enabled: true
|
727
|
-
Style/InfiniteLoop:
|
728
|
-
Description: Use Kernel#loop for infinite loops.
|
729
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
|
730
|
-
Enabled: true
|
731
347
|
Style/Lambda:
|
732
348
|
Description: Use the new lambda literal syntax for single-line blocks.
|
733
349
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
|
734
350
|
Enabled: false
|
735
|
-
Layout/LeadingCommentSpace:
|
736
|
-
Description: Comments should start with a space.
|
737
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
|
738
|
-
Enabled: true
|
739
351
|
Style/LineEndConcatenation:
|
740
352
|
Description: Use \ instead of + or << to concatenate two string literals at line
|
741
353
|
end.
|
742
354
|
Enabled: false
|
743
|
-
Style/MethodCallWithoutArgsParentheses:
|
744
|
-
Description: Do not use parentheses for method calls with no arguments.
|
745
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
|
746
|
-
Enabled: true
|
747
355
|
Style/ModuleFunction:
|
748
356
|
Description: Checks for usage of `extend self` in modules.
|
749
357
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
@@ -755,14 +363,6 @@ Style/MultilineBlockChain:
|
|
755
363
|
Layout/MultilineBlockLayout:
|
756
364
|
Description: Ensures newlines after multiline block do statements.
|
757
365
|
Enabled: false
|
758
|
-
Style/MultilineIfThen:
|
759
|
-
Description: Do not use then for multi-line if/unless.
|
760
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
|
761
|
-
Enabled: true
|
762
|
-
Style/MultilineTernaryOperator:
|
763
|
-
Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
|
764
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
|
765
|
-
Enabled: true
|
766
366
|
Style/NegatedIf:
|
767
367
|
Description: Favor unless over if for negative conditions (or control flow or).
|
768
368
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
|
@@ -771,23 +371,15 @@ Style/NegatedWhile:
|
|
771
371
|
Description: Favor until over while for negative conditions.
|
772
372
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
|
773
373
|
Enabled: false
|
774
|
-
Style/NestedTernaryOperator:
|
775
|
-
Description: Use one expression per branch in a ternary operator.
|
776
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
|
777
|
-
Enabled: true
|
778
374
|
Style/NilComparison:
|
779
375
|
Description: Prefer x.nil? to x == nil.
|
780
376
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
781
377
|
Enabled: false
|
782
|
-
Style/Not:
|
783
|
-
Description: Use ! instead of not.
|
784
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
|
785
|
-
Enabled: true
|
786
378
|
Style/OneLineConditional:
|
787
379
|
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
788
380
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
789
381
|
Enabled: false
|
790
|
-
|
382
|
+
Naming/BinaryOperatorParameterName:
|
791
383
|
Description: When defining binary operators, name the argument other.
|
792
384
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
793
385
|
Enabled: false
|
@@ -799,107 +391,27 @@ Style/Proc:
|
|
799
391
|
Description: Use proc instead of Proc.new.
|
800
392
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
|
801
393
|
Enabled: false
|
802
|
-
Style/RedundantBegin:
|
803
|
-
Description: Don't use begin blocks when they are not needed.
|
804
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
|
805
|
-
Enabled: true
|
806
|
-
Style/RedundantException:
|
807
|
-
Description: Checks for an obsolete RuntimeException argument in raise/fail.
|
808
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
|
809
|
-
Enabled: true
|
810
|
-
Style/RedundantSelf:
|
811
|
-
Description: Don't use self where it's not needed.
|
812
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
|
813
|
-
Enabled: true
|
814
|
-
Style/RescueModifier:
|
815
|
-
Description: Avoid using rescue in its modifier form.
|
816
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
|
817
|
-
Enabled: true
|
818
394
|
Style/SelfAssignment:
|
819
395
|
Description: Checks for places where self-assignment shorthand should have been
|
820
396
|
used.
|
821
397
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
|
822
398
|
Enabled: false
|
823
|
-
Layout/SpaceAfterColon:
|
824
|
-
Description: Use spaces after colons.
|
825
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
826
|
-
Enabled: true
|
827
|
-
Layout/SpaceAfterComma:
|
828
|
-
Description: Use spaces after commas.
|
829
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
830
|
-
Enabled: true
|
831
|
-
Layout/SpaceAroundKeyword:
|
832
|
-
Description: Use a space around keywords if appropriate.
|
833
|
-
Enabled: true
|
834
|
-
Layout/SpaceAfterMethodName:
|
835
|
-
Description: Do not put a space between a method name and the opening parenthesis
|
836
|
-
in a method definition.
|
837
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
838
|
-
Enabled: true
|
839
|
-
Layout/SpaceAfterNot:
|
840
|
-
Description: Tracks redundant space after the ! operator.
|
841
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
|
842
|
-
Enabled: true
|
843
|
-
Layout/SpaceAfterSemicolon:
|
844
|
-
Description: Use spaces after semicolons.
|
845
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
846
|
-
Enabled: true
|
847
|
-
Layout/SpaceBeforeComma:
|
848
|
-
Description: No spaces before commas.
|
849
|
-
Enabled: true
|
850
|
-
Layout/SpaceBeforeComment:
|
851
|
-
Description: Checks for missing space between code and a comment on the same line.
|
852
|
-
Enabled: true
|
853
399
|
Layout/SpaceBeforeFirstArg:
|
854
400
|
Description: Put a space between a method name and the first argument in a method
|
855
401
|
call without parentheses.
|
856
402
|
Enabled: true
|
857
|
-
Layout/SpaceBeforeSemicolon:
|
858
|
-
Description: No spaces before semicolons.
|
859
|
-
Enabled: true
|
860
403
|
Layout/SpaceAroundOperators:
|
861
404
|
Description: Use spaces around operators.
|
862
405
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
863
406
|
Enabled: true
|
864
|
-
Layout/SpaceInsideBrackets:
|
865
|
-
Description: No spaces after [ or before ].
|
866
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
867
|
-
Enabled: true
|
868
407
|
Layout/SpaceInsideParens:
|
869
408
|
Description: No spaces after ( or before ).
|
870
409
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
871
410
|
Enabled: true
|
872
|
-
Layout/SpaceInsideRangeLiteral:
|
873
|
-
Description: No spaces inside range literals.
|
874
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
|
875
|
-
Enabled: true
|
876
411
|
Style/SpecialGlobalVars:
|
877
412
|
Description: Avoid Perl-style global variables.
|
878
413
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
879
414
|
Enabled: false
|
880
|
-
Style/StructInheritance:
|
881
|
-
Description: Checks for inheritance from Struct.new.
|
882
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
|
883
|
-
Enabled: true
|
884
|
-
Layout/Tab:
|
885
|
-
Description: No hard tabs.
|
886
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
887
|
-
Enabled: true
|
888
|
-
Layout/TrailingWhitespace:
|
889
|
-
Description: Avoid trailing whitespace.
|
890
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
|
891
|
-
Enabled: true
|
892
|
-
Style/UnlessElse:
|
893
|
-
Description: Do not use unless with else. Rewrite these with the positive case first.
|
894
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
|
895
|
-
Enabled: true
|
896
|
-
Style/UnneededCapitalW:
|
897
|
-
Description: Checks for %W when interpolation is not needed.
|
898
|
-
Enabled: true
|
899
|
-
Style/UnneededPercentQ:
|
900
|
-
Description: Checks for %q/%Q when single quotes or double quotes would do.
|
901
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
|
902
|
-
Enabled: true
|
903
415
|
Style/VariableInterpolation:
|
904
416
|
Description: Don't interpolate global, instance and class variables directly in
|
905
417
|
strings.
|
@@ -909,10 +421,6 @@ Style/WhenThen:
|
|
909
421
|
Description: Use when x then ... for one-line cases.
|
910
422
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
911
423
|
Enabled: false
|
912
|
-
Style/WhileUntilDo:
|
913
|
-
Description: Checks for redundant do after while or until.
|
914
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
|
915
|
-
Enabled: true
|
916
424
|
Lint/AmbiguousOperator:
|
917
425
|
Description: Checks for ambiguous operators in the first argument of a method invocation
|
918
426
|
without parentheses.
|
@@ -922,51 +430,25 @@ Lint/AmbiguousRegexpLiteral:
|
|
922
430
|
Description: Checks for ambiguous regexp literals in the first argument of a method
|
923
431
|
invocation without parenthesis.
|
924
432
|
Enabled: false
|
925
|
-
|
433
|
+
Layout/BlockAlignment:
|
926
434
|
Description: Align block ends correctly.
|
927
435
|
Enabled: true
|
928
|
-
|
436
|
+
Layout/ConditionPosition:
|
929
437
|
Description: Checks for condition placed in a confusing position relative to the
|
930
438
|
keyword.
|
931
439
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
932
440
|
Enabled: false
|
933
|
-
Lint/Debugger:
|
934
|
-
Description: Check for debugger calls.
|
935
|
-
Enabled: true
|
936
441
|
Lint/DeprecatedClassMethods:
|
937
442
|
Description: Check for deprecated class method calls.
|
938
443
|
Enabled: false
|
939
|
-
Lint/DuplicateMethods:
|
940
|
-
Description: Check for duplicate methods calls.
|
941
|
-
Enabled: true
|
942
444
|
Lint/ElseLayout:
|
943
445
|
Description: Check for odd code arrangement in an else block.
|
944
446
|
Enabled: false
|
945
|
-
Lint/EmptyEnsure:
|
946
|
-
Description: Checks for empty ensure block.
|
947
|
-
Enabled: true
|
948
|
-
Lint/EmptyInterpolation:
|
949
|
-
Description: Checks for empty string interpolation.
|
950
|
-
Enabled: true
|
951
|
-
Lint/EndInMethod:
|
952
|
-
Description: END blocks should not be placed inside method definitions.
|
953
|
-
Enabled: true
|
954
|
-
Lint/EnsureReturn:
|
955
|
-
Description: Do not use return in an ensure block.
|
956
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
|
957
|
-
Enabled: true
|
958
|
-
Security/Eval:
|
959
|
-
Description: The use of eval represents a serious security risk.
|
960
|
-
Enabled: true
|
961
447
|
Lint/HandleExceptions:
|
962
448
|
Description: Don't suppress exception.
|
963
449
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
964
450
|
Enabled: false
|
965
|
-
Lint/
|
966
|
-
Description: Checks for invalid character literals with a non-escaped whitespace
|
967
|
-
character.
|
968
|
-
Enabled: false
|
969
|
-
Lint/LiteralInCondition:
|
451
|
+
Lint/LiteralAsCondition:
|
970
452
|
Description: Checks of literals used in conditions.
|
971
453
|
Enabled: false
|
972
454
|
Lint/LiteralInInterpolation:
|
@@ -984,48 +466,9 @@ Lint/ParenthesesAsGroupedExpression:
|
|
984
466
|
Lint/RequireParentheses:
|
985
467
|
Description: Use parentheses in the method call to avoid confusion about precedence.
|
986
468
|
Enabled: false
|
987
|
-
Lint/RescueException:
|
988
|
-
Description: Avoid rescuing the Exception class.
|
989
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
|
990
|
-
Enabled: true
|
991
|
-
Lint/ShadowingOuterLocalVariable:
|
992
|
-
Description: Do not use the same name as outer local variable for block arguments
|
993
|
-
or block local variables.
|
994
|
-
Enabled: true
|
995
|
-
Lint/StringConversionInInterpolation:
|
996
|
-
Description: Checks for Object#to_s usage in string interpolation.
|
997
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
|
998
|
-
Enabled: true
|
999
469
|
Lint/UnderscorePrefixedVariableName:
|
1000
470
|
Description: Do not use prefix `_` for a variable that is used.
|
1001
471
|
Enabled: false
|
1002
|
-
Lint/UnusedBlockArgument:
|
1003
|
-
Description: Checks for unused block arguments.
|
1004
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1005
|
-
Enabled: true
|
1006
|
-
Lint/UnusedMethodArgument:
|
1007
|
-
Description: Checks for unused method arguments.
|
1008
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1009
|
-
Enabled: true
|
1010
|
-
Lint/UnreachableCode:
|
1011
|
-
Description: Unreachable code.
|
1012
|
-
Enabled: true
|
1013
|
-
Lint/UselessAccessModifier:
|
1014
|
-
Description: Checks for useless access modifiers.
|
1015
|
-
Enabled: true
|
1016
|
-
Lint/UselessAssignment:
|
1017
|
-
Description: Checks for useless assignment to a local variable.
|
1018
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1019
|
-
Enabled: true
|
1020
|
-
Lint/UselessComparison:
|
1021
|
-
Description: Checks for comparison of something with itself.
|
1022
|
-
Enabled: true
|
1023
|
-
Lint/UselessElseWithoutRescue:
|
1024
|
-
Description: Checks for useless `else` in `begin..end` without `rescue`.
|
1025
|
-
Enabled: true
|
1026
|
-
Lint/UselessSetterCall:
|
1027
|
-
Description: Checks for useless setter call to a local variable.
|
1028
|
-
Enabled: true
|
1029
472
|
Lint/Void:
|
1030
473
|
Description: Possible use of operator/literal/variable in void context.
|
1031
474
|
Enabled: false
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7
|
data/CHANGELOG.md
CHANGED
@@ -2,11 +2,17 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
### v0.2.0
|
6
|
+
|
7
|
+
##### Changed
|
8
|
+
|
9
|
+
* Replace travis with circleci.
|
10
|
+
|
5
11
|
### v0.1.1
|
6
12
|
|
7
13
|
##### Fixed
|
8
14
|
|
9
|
-
* Travis config
|
15
|
+
* Travis config.
|
10
16
|
|
11
17
|
### v0.1.0
|
12
18
|
|
data/README.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Parxer
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/parxer)
|
4
|
+
[](https://coveralls.io/github/platanus/parxer?branch=master)
|
5
|
+
|
6
|
+
Parxer is another parser for xls, xlsx and csv files. But the big plus is that this ruby gem also has a nice DSL to help us with:
|
7
|
+
|
8
|
+
- Column mapping.
|
9
|
+
- File, row, and column/cell validation.
|
10
|
+
- Column/cell formatting.
|
4
11
|
|
5
12
|
## Installation
|
6
13
|
|
@@ -95,19 +102,7 @@ As you can see...
|
|
95
102
|
3. `idx` attribute is the row number.
|
96
103
|
4. the custom `full_name` attribute was added as a part of the response.
|
97
104
|
|
98
|
-
|
99
|
-
|
100
|
-
**In parser context:**
|
101
|
-
|
102
|
-
- `parser.valid_file?`
|
103
|
-
- `parser.file_error`
|
104
|
-
- `parser.run`
|
105
|
-
|
106
|
-
**In row (`row = result.next`) context:**
|
107
|
-
|
108
|
-
- `row.errors?`
|
109
|
-
- `row.errors`
|
110
|
-
- `row.attribute_error?(:some_attribute_name)`
|
105
|
+
For further information please go to the [Wiki](https://github.com/platanus/parxer/wiki)
|
111
106
|
|
112
107
|
## Testing
|
113
108
|
|
data/bin/console
CHANGED
data/lib/parxer.rb
CHANGED
@@ -4,7 +4,14 @@ require "active_support/all"
|
|
4
4
|
require "roo"
|
5
5
|
require "roo-xls"
|
6
6
|
|
7
|
-
require_rel "parxer"
|
7
|
+
require_rel "parxer/utils/*.rb"
|
8
|
+
require_rel "parxer/collections/*.rb"
|
9
|
+
require_rel "parxer/formatters/*.rb"
|
10
|
+
require_rel "parxer/validators/*.rb"
|
11
|
+
require_rel "parxer/values/*.rb"
|
12
|
+
require_rel "parxer/dsl/*.rb"
|
13
|
+
require_rel "parxer/parsers/concerns/*.rb"
|
14
|
+
require_rel "parxer/parsers/*.rb"
|
8
15
|
|
9
16
|
module Parxer
|
10
17
|
end
|
data/lib/parxer/version.rb
CHANGED
data/parxer.gemspec
CHANGED
@@ -19,14 +19,17 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "require_all"
|
23
22
|
spec.add_dependency "activesupport"
|
23
|
+
spec.add_dependency "require_all"
|
24
24
|
spec.add_dependency "roo"
|
25
25
|
spec.add_dependency "roo-xls"
|
26
|
-
|
27
|
-
spec.add_development_dependency "
|
28
|
-
spec.add_development_dependency "rspec", "~> 3.4"
|
26
|
+
|
27
|
+
spec.add_development_dependency "coveralls"
|
29
28
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
30
29
|
spec.add_development_dependency "pry"
|
31
|
-
spec.add_development_dependency "
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
32
|
+
spec.add_development_dependency "rspec_junit_formatter"
|
33
|
+
spec.add_development_dependency "rubocop", "~> 0.65.0"
|
34
|
+
spec.add_development_dependency "rubocop-rspec"
|
32
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platanus
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: require_all
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
@@ -68,19 +68,47 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: coveralls
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: guard-rspec
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
88
|
- - "~>"
|
75
89
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
90
|
+
version: '4.7'
|
77
91
|
type: :development
|
78
92
|
prerelease: false
|
79
93
|
version_requirements: !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
95
|
- - "~>"
|
82
96
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
97
|
+
version: '4.7'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: pry
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
84
112
|
- !ruby/object:Gem::Dependency
|
85
113
|
name: rake
|
86
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,35 +138,35 @@ dependencies:
|
|
110
138
|
- !ruby/object:Gem::Version
|
111
139
|
version: '3.4'
|
112
140
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
141
|
+
name: rspec_junit_formatter
|
114
142
|
requirement: !ruby/object:Gem::Requirement
|
115
143
|
requirements:
|
116
|
-
- - "
|
144
|
+
- - ">="
|
117
145
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
146
|
+
version: '0'
|
119
147
|
type: :development
|
120
148
|
prerelease: false
|
121
149
|
version_requirements: !ruby/object:Gem::Requirement
|
122
150
|
requirements:
|
123
|
-
- - "
|
151
|
+
- - ">="
|
124
152
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
153
|
+
version: '0'
|
126
154
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
155
|
+
name: rubocop
|
128
156
|
requirement: !ruby/object:Gem::Requirement
|
129
157
|
requirements:
|
130
|
-
- - "
|
158
|
+
- - "~>"
|
131
159
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
160
|
+
version: 0.65.0
|
133
161
|
type: :development
|
134
162
|
prerelease: false
|
135
163
|
version_requirements: !ruby/object:Gem::Requirement
|
136
164
|
requirements:
|
137
|
-
- - "
|
165
|
+
- - "~>"
|
138
166
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
167
|
+
version: 0.65.0
|
140
168
|
- !ruby/object:Gem::Dependency
|
141
|
-
name:
|
169
|
+
name: rubocop-rspec
|
142
170
|
requirement: !ruby/object:Gem::Requirement
|
143
171
|
requirements:
|
144
172
|
- - ">="
|
@@ -159,13 +187,14 @@ executables: []
|
|
159
187
|
extensions: []
|
160
188
|
extra_rdoc_files: []
|
161
189
|
files:
|
190
|
+
- ".circleci/config.yml"
|
191
|
+
- ".circleci/setup-rubygems.sh"
|
162
192
|
- ".coveralls.yml"
|
163
193
|
- ".gitignore"
|
164
194
|
- ".hound.yml"
|
165
195
|
- ".rspec"
|
166
196
|
- ".rubocop.yml"
|
167
197
|
- ".ruby-version"
|
168
|
-
- ".travis.yml"
|
169
198
|
- CHANGELOG.md
|
170
199
|
- Gemfile
|
171
200
|
- Guardfile
|
@@ -239,8 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
268
|
- !ruby/object:Gem::Version
|
240
269
|
version: '0'
|
241
270
|
requirements: []
|
242
|
-
|
243
|
-
rubygems_version: 2.5.2
|
271
|
+
rubygems_version: 3.1.6
|
244
272
|
signing_key:
|
245
273
|
specification_version: 4
|
246
274
|
summary: ruby gem to parse data
|
data/.travis.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.3.1
|
4
|
-
before_install: gem install bundler -v 1.12.5
|
5
|
-
deploy:
|
6
|
-
provider: rubygems
|
7
|
-
api_key:
|
8
|
-
secure: wKW5LVpI/tvuXAJjWc3P6g9K1qlIphBm5xNaSZVVm8C3o7MMypsPLX7+U3Bhz23mgkyBI5JSUx46a7fNm2xeKdXKZ5g5i72zpxJ0g7NbD3kTg5iZdYIJw75qQKoMMdYEAwZa6ojVtFQV8r9kcC/nKrULruy7t2wC9eIJ4WeLo7IsU5McdAcT8c177p8YdS/Yh+V0wNu62rto8FByz9yvgyzXYAmKQ1Dni9xMttvC2bTAtnBO9/ghUQl0qNbqpJD7QZAockomB8uPqhcIjAdg5KNVsa7HZCvPXKn453oWVXFsXoZqFTMftU/cknbf+Gip0+KVMUHcW1Dqq5PAvEiTp46KtJEFWLKwMPl0QSgN3/5DM3zbLQIXFGcJkbrMno1BUlHdUVB6TZ9B7Owx37khOw1TEdvf1ROuV6qCn266hs7xxKdLMpD3keD6ONYzyxFBOXGsuSAin5BvRc9LwR44PRdFgHH7GvpgxX1ajujmNH2cfdabmsLsYEqee4ZIA2K7ZybLv1SvMEvfUau1O3Ahg/1xgHHPB0iYfu0CdqAUquzXcpyX1hce1ANqljCVBG8YhOfunNxTJ43vnE6L02PxOqQMah3rE47oeFyiGHokKNJg9NJwpTlXgucdOUogtoSXoYBGUA81TdqaJBcD2QOVAZlguuNLiXcPVwFyGTjsL54=
|
9
|
-
gem: parxer
|
10
|
-
on:
|
11
|
-
tags: true
|
12
|
-
repo: platanus/parxer
|