niftany 0.5.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +25 -0
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +1 -1
- data/.ruby-version +1 -1
- data/exe/niftany +10 -4
- data/niftany.gemspec +5 -2
- data/niftany_erblint.yml +2 -2
- data/niftany_rubocop_rails.yml +2 -0
- data/niftany_rubocop_rspec.yml +8 -0
- data/niftany_rubocop_ruby.yml +2 -0
- data/rubocop/layout.yml +14 -2
- data/rubocop/lint.yml +9 -2
- data/rubocop/metrics.yml +4 -7
- data/rubocop/naming.yml +1 -1
- data/rubocop/style.yml +15 -6
- metadata +24 -10
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7d595491f6830b1348ae95055cfcc9f07c7aa63aa4d3f2ec480131a2b954fcd
|
4
|
+
data.tar.gz: 68501f826457628cec281a8f0dcbe406d225c432b6a244780ac6705d3cbd54a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da186b9080ca9587e1354369716cb00a01ab1b6117e0e61a659bab1890499f12d580c977152699465d2bc3edcacc63534694817c10d9d48b7047e21450edea94
|
7
|
+
data.tar.gz: 7c8507cc4510803d5044df304b46a4c4448e15e5296a91e41a7cc640cf0414957f4a1200e42e5df93e00ca84f5c2fb81df194ec4285d9660e0a022400974954c
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version: ['2.6', '2.7']
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby-version }}
|
23
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
24
|
+
- name: Run Rubocop
|
25
|
+
run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
inherit_from: .
|
1
|
+
inherit_from: niftany_rubocop.yml
|
2
2
|
|
data/.rubocop_todo.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/exe/niftany
CHANGED
@@ -12,6 +12,7 @@ require 'colorize'
|
|
12
12
|
def parse_opts(args)
|
13
13
|
options = OpenStruct.new
|
14
14
|
options.auto_correct = false
|
15
|
+
options.parallel = false
|
15
16
|
|
16
17
|
parser = OptionParser.new do |opts|
|
17
18
|
opts.banner = 'Usage: niftany [options]'
|
@@ -20,6 +21,10 @@ def parse_opts(args)
|
|
20
21
|
options.auto_correct = auto
|
21
22
|
end
|
22
23
|
|
24
|
+
opts.on('-p', '--parallel', 'Run RuboCop in parallel') do |parallel|
|
25
|
+
options.parallel = parallel
|
26
|
+
end
|
27
|
+
|
23
28
|
opts.on_tail('-h', '--help', 'Show this message') do
|
24
29
|
puts opts
|
25
30
|
exit
|
@@ -30,9 +35,10 @@ def parse_opts(args)
|
|
30
35
|
end
|
31
36
|
|
32
37
|
def rubocop_options(options)
|
33
|
-
|
34
|
-
|
35
|
-
|
38
|
+
rubocop_options = []
|
39
|
+
rubocop_options.append('--auto-correct') if options.auto_correct
|
40
|
+
rubocop_options.append('--parallel') if options.parallel
|
41
|
+
rubocop_options
|
36
42
|
end
|
37
43
|
|
38
44
|
def erblint_options(options)
|
@@ -65,7 +71,7 @@ else
|
|
65
71
|
end
|
66
72
|
|
67
73
|
puts 'Running SCSSLint'.yellow
|
68
|
-
logger = SCSSLint::Logger.new(
|
74
|
+
logger = SCSSLint::Logger.new($stdout)
|
69
75
|
scss_lint = SCSSLint::CLI.new(logger).run(ARGV) # returns integer
|
70
76
|
|
71
77
|
if scss_lint.zero?
|
data/niftany.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'niftany'
|
5
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.9.0'
|
6
6
|
spec.authors = ['Adam Wead']
|
7
7
|
spec.email = ['amsterdamos@gmail.com']
|
8
8
|
spec.summary = 'Manages configurations and versions of linters used in projects at '\
|
@@ -13,10 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.bindir = 'exe'
|
14
14
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
15
15
|
|
16
|
+
spec.required_ruby_version = '>= 2.6.0'
|
17
|
+
|
16
18
|
spec.add_dependency 'colorize', '~> 0.8.1'
|
17
19
|
spec.add_dependency 'erb_lint', '~> 0.0.22'
|
18
|
-
spec.add_dependency 'rubocop', '~> 0.
|
20
|
+
spec.add_dependency 'rubocop', '~> 0.79'
|
19
21
|
spec.add_dependency 'rubocop-performance', '~> 1.1'
|
22
|
+
spec.add_dependency 'rubocop-rails', '~> 2.3'
|
20
23
|
spec.add_dependency 'rubocop-rspec', '~> 1.3'
|
21
24
|
spec.add_dependency 'scss_lint', '~> 0.55'
|
22
25
|
|
data/niftany_erblint.yml
CHANGED
@@ -22,7 +22,7 @@ linters:
|
|
22
22
|
- niftany_rubocop_rails.yml
|
23
23
|
Layout/InitialIndentation:
|
24
24
|
Enabled: false
|
25
|
-
Layout/
|
25
|
+
Layout/TrailingEmptyLines:
|
26
26
|
Enabled: false
|
27
27
|
Layout/TrailingWhitespace:
|
28
28
|
Enabled: false
|
@@ -30,7 +30,7 @@ linters:
|
|
30
30
|
Enabled: false
|
31
31
|
Style/FrozenStringLiteralComment:
|
32
32
|
Enabled: false
|
33
|
-
|
33
|
+
Layout/LineLength:
|
34
34
|
Enabled: false
|
35
35
|
Lint/UselessAssignment:
|
36
36
|
Enabled: false
|
data/niftany_rubocop_rails.yml
CHANGED
data/niftany_rubocop_rspec.yml
CHANGED
data/niftany_rubocop_ruby.yml
CHANGED
data/rubocop/layout.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
Layout/
|
2
|
+
Layout/ParameterAlignment:
|
3
3
|
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
|
4
4
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
5
5
|
Enabled: false
|
@@ -41,8 +41,20 @@ Layout/ConditionPosition:
|
|
41
41
|
|
42
42
|
Layout/IndentationConsistency:
|
43
43
|
Description: 'Checks for inconsistent indentation.'
|
44
|
-
EnforcedStyle:
|
44
|
+
EnforcedStyle: indented_internal_methods
|
45
45
|
|
46
46
|
Layout/MultilineBlockLayout:
|
47
47
|
Description: 'Checks whether the multiline do end blocks have a newline after the start of the block.'
|
48
48
|
Enabled: true
|
49
|
+
|
50
|
+
Layout/LineLength:
|
51
|
+
Description: 'Limit lines to 120 characters.'
|
52
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
53
|
+
Enabled: true
|
54
|
+
Max: 120
|
55
|
+
|
56
|
+
Layout/SpaceAroundMethodCallOperator:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
60
|
+
Enabled: true
|
data/rubocop/lint.yml
CHANGED
@@ -25,7 +25,7 @@ Lint/DeprecatedClassMethods:
|
|
25
25
|
Description: 'Check for deprecated class method calls.'
|
26
26
|
Enabled: false
|
27
27
|
|
28
|
-
Lint/
|
28
|
+
Lint/DuplicateHashKey:
|
29
29
|
Description: 'Check for duplicate keys in hash literals.'
|
30
30
|
Enabled: true
|
31
31
|
|
@@ -41,7 +41,7 @@ Lint/FormatParameterMismatch:
|
|
41
41
|
Description: 'The number of parameters to format/sprint must match the fields.'
|
42
42
|
Enabled: false
|
43
43
|
|
44
|
-
Lint/
|
44
|
+
Lint/SuppressedException:
|
45
45
|
Description: "Don't suppress exception."
|
46
46
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
47
47
|
Enabled: false
|
@@ -101,3 +101,10 @@ Lint/UselessAssignment:
|
|
101
101
|
Checks for every useless assignment to local variable in every scope.
|
102
102
|
The basic idea for this cop was from the warning of `ruby -cw`:'
|
103
103
|
Enabled: true
|
104
|
+
|
105
|
+
Lint/RaiseException:
|
106
|
+
Description: 'This cop checks for raise or fail statements which are raising Exception class.'
|
107
|
+
Enabled: true
|
108
|
+
|
109
|
+
Lint/StructNewOverride:
|
110
|
+
Enabled: true
|
data/rubocop/metrics.yml
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
---
|
2
|
+
Metrics/BlockLength:
|
3
|
+
Exclude:
|
4
|
+
- 'spec/**/*'
|
5
|
+
|
2
6
|
Metrics/BlockNesting:
|
3
7
|
Description: 'Avoid excessive block nesting'
|
4
8
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
@@ -30,13 +34,6 @@ Metrics/PerceivedComplexity:
|
|
30
34
|
the reader experiences when looking at a method
|
31
35
|
Enabled: true
|
32
36
|
|
33
|
-
# Override style guide to allow length of up to 120 characters.
|
34
|
-
Metrics/LineLength:
|
35
|
-
Description: 'Limit lines to 120 characters.'
|
36
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
37
|
-
Enabled: true
|
38
|
-
Max: 120
|
39
|
-
|
40
37
|
Metrics/MethodLength:
|
41
38
|
Description: 'Avoid methods longer than 10 lines of code.'
|
42
39
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
data/rubocop/naming.yml
CHANGED
@@ -21,7 +21,7 @@ Naming/BinaryOperatorParameterName:
|
|
21
21
|
Naming/PredicateName:
|
22
22
|
Description: 'Check the names of predicate methods.'
|
23
23
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
24
|
-
|
24
|
+
ForbiddenPrefixes:
|
25
25
|
- is_
|
26
26
|
|
27
27
|
Naming/VariableName:
|
data/rubocop/style.yml
CHANGED
@@ -19,12 +19,6 @@ Style/Attr:
|
|
19
19
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
20
20
|
Enabled: false
|
21
21
|
|
22
|
-
Style/BracesAroundHashParameters:
|
23
|
-
Description: >-
|
24
|
-
Checks for braces around the last parameter in a method call if the last parameter is a hash.
|
25
|
-
It supports 3 styles: braces, no_braces, context_dependent
|
26
|
-
Enabled: true
|
27
|
-
|
28
22
|
Style/CaseEquality:
|
29
23
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
30
24
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
@@ -315,3 +309,18 @@ Style/Sample:
|
|
315
309
|
`shuffle.last`, and `shuffle[Fixnum]`.
|
316
310
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
317
311
|
Enabled: false
|
312
|
+
|
313
|
+
Style/ExponentialNotation:
|
314
|
+
Enabled: true
|
315
|
+
|
316
|
+
Style/HashEachMethods:
|
317
|
+
Enabled: true
|
318
|
+
|
319
|
+
Style/HashTransformKeys:
|
320
|
+
Enabled: false
|
321
|
+
|
322
|
+
Style/HashTransformValues:
|
323
|
+
Enabled: false
|
324
|
+
|
325
|
+
Style/SlicingWithRange:
|
326
|
+
Enabled: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: niftany
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Wead
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.79'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.79'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubocop-performance
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.3'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.3'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rubocop-rspec
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,11 +146,11 @@ extensions: []
|
|
132
146
|
extra_rdoc_files: []
|
133
147
|
files:
|
134
148
|
- ".erb-linters/self_closing_custom.rb"
|
149
|
+
- ".github/workflows/ci.yml"
|
135
150
|
- ".gitignore"
|
136
151
|
- ".rubocop.yml"
|
137
152
|
- ".rubocop_todo.yml"
|
138
153
|
- ".ruby-version"
|
139
|
-
- ".travis.yml"
|
140
154
|
- Gemfile
|
141
155
|
- LICENSE.md
|
142
156
|
- README.md
|
@@ -160,7 +174,7 @@ files:
|
|
160
174
|
homepage: https://github.com/psu-libraries/niftany
|
161
175
|
licenses: []
|
162
176
|
metadata: {}
|
163
|
-
post_install_message:
|
177
|
+
post_install_message:
|
164
178
|
rdoc_options: []
|
165
179
|
require_paths:
|
166
180
|
- lib
|
@@ -168,15 +182,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
182
|
requirements:
|
169
183
|
- - ">="
|
170
184
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
185
|
+
version: 2.6.0
|
172
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
187
|
requirements:
|
174
188
|
- - ">="
|
175
189
|
- !ruby/object:Gem::Version
|
176
190
|
version: '0'
|
177
191
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
179
|
-
signing_key:
|
192
|
+
rubygems_version: 3.1.4
|
193
|
+
signing_key:
|
180
194
|
specification_version: 4
|
181
195
|
summary: Manages configurations and versions of linters used in projects at Penn State
|
182
196
|
University Libraries.
|