slim_lint 0.17.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +10 -9
- data/lib/slim_lint.rb +4 -4
- data/lib/slim_lint/cli.rb +19 -12
- data/lib/slim_lint/file_finder.rb +1 -1
- data/lib/slim_lint/linter/comment_control_statement.rb +2 -0
- data/lib/slim_lint/linter/control_statement_spacing.rb +0 -1
- data/lib/slim_lint/version.rb +1 -1
- metadata +5 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70c5fb4937778a7f451600310d934305853a938b8bf08df3e3c08b28f680b2a4
|
4
|
+
data.tar.gz: a1b2e962a79cf35c060768d562997e04bb0835a8d474cd1c85b54c22c98b3af7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0105fb2ef8ba6551b8a98f55677d939f922405150477cdaff62118caabb8d99f1c07426283e590e9ffb6fc9098bdd01c4214db612659f37fb4a087dd506836a
|
7
|
+
data.tar.gz: 8559c4cf8e7850a11657b9cffa9ff09fa6c08c4283f33638f7b604c63859ac24c52ff9c8e3366c7900a678240ae5876d71eb58de2bd2a8853138ec4e7a56af30
|
data/config/default.yml
CHANGED
@@ -42,16 +42,18 @@ linters:
|
|
42
42
|
# WARNING: If you define this list in your own .slim-lint.yml file, you'll
|
43
43
|
# be overriding the list defined here.
|
44
44
|
ignored_cops:
|
45
|
-
- Layout/
|
46
|
-
- Layout/
|
47
|
-
- Layout/
|
48
|
-
- Layout/AlignParameters
|
45
|
+
- Layout/ArgumentAlignment
|
46
|
+
- Layout/ArrayAlignment
|
47
|
+
- Layout/BlockAlignment
|
49
48
|
- Layout/EmptyLineAfterGuardClause
|
49
|
+
- Layout/EndAlignment
|
50
|
+
- Layout/FirstArrayElementIndentation
|
50
51
|
- Layout/FirstParameterIndentation
|
51
|
-
- Layout/
|
52
|
+
- Layout/HashAlignment
|
52
53
|
- Layout/IndentationConsistency
|
53
54
|
- Layout/IndentationWidth
|
54
55
|
- Layout/InitialIndentation
|
56
|
+
- Layout/LineLength
|
55
57
|
- Layout/MultilineArrayBraceLayout
|
56
58
|
- Layout/MultilineAssignmentLayout
|
57
59
|
- Layout/MultilineHashBraceLayout
|
@@ -59,16 +61,15 @@ linters:
|
|
59
61
|
- Layout/MultilineMethodCallIndentation
|
60
62
|
- Layout/MultilineMethodDefinitionBraceLayout
|
61
63
|
- Layout/MultilineOperationIndentation
|
62
|
-
- Layout/
|
64
|
+
- Layout/ParameterAlignment
|
65
|
+
- Layout/TrailingEmptyLines
|
63
66
|
- Layout/TrailingWhitespace
|
64
|
-
- Lint/BlockAlignment
|
65
|
-
- Lint/EndAlignment
|
66
67
|
- Lint/Void
|
67
68
|
- Metrics/BlockLength
|
68
69
|
- Metrics/BlockNesting
|
69
|
-
- Metrics/LineLength
|
70
70
|
- Naming/FileName
|
71
71
|
- Style/FrozenStringLiteralComment
|
72
|
+
- Style/IdenticalConditionalBranches
|
72
73
|
- Style/IfUnlessModifier
|
73
74
|
- Style/Next
|
74
75
|
- Style/WhileUntilModifier
|
data/lib/slim_lint.rb
CHANGED
@@ -19,7 +19,7 @@ require 'slim_lint/logger'
|
|
19
19
|
require 'slim_lint/version'
|
20
20
|
|
21
21
|
# Load all filters (required by SlimLint::Engine)
|
22
|
-
Dir[File.expand_path('slim_lint/filters/*.rb', File.dirname(__FILE__))].each do |file|
|
22
|
+
Dir[File.expand_path('slim_lint/filters/*.rb', File.dirname(__FILE__))].sort.each do |file|
|
23
23
|
require file
|
24
24
|
end
|
25
25
|
|
@@ -37,16 +37,16 @@ require 'slim_lint/runner'
|
|
37
37
|
|
38
38
|
# Load all matchers
|
39
39
|
require 'slim_lint/matcher/base'
|
40
|
-
Dir[File.expand_path('slim_lint/matcher/*.rb', File.dirname(__FILE__))].each do |file|
|
40
|
+
Dir[File.expand_path('slim_lint/matcher/*.rb', File.dirname(__FILE__))].sort.each do |file|
|
41
41
|
require file
|
42
42
|
end
|
43
43
|
|
44
44
|
# Load all linters
|
45
|
-
Dir[File.expand_path('slim_lint/linter/*.rb', File.dirname(__FILE__))].each do |file|
|
45
|
+
Dir[File.expand_path('slim_lint/linter/*.rb', File.dirname(__FILE__))].sort.each do |file|
|
46
46
|
require file
|
47
47
|
end
|
48
48
|
|
49
49
|
# Load all reporters
|
50
|
-
Dir[File.expand_path('slim_lint/reporter/*.rb', File.dirname(__FILE__))].each do |file|
|
50
|
+
Dir[File.expand_path('slim_lint/reporter/*.rb', File.dirname(__FILE__))].sort.each do |file|
|
51
51
|
require file
|
52
52
|
end
|
data/lib/slim_lint/cli.rb
CHANGED
@@ -3,11 +3,18 @@
|
|
3
3
|
require 'slim_lint'
|
4
4
|
require 'slim_lint/options'
|
5
5
|
|
6
|
-
require 'sysexits'
|
7
|
-
|
8
6
|
module SlimLint
|
9
7
|
# Command line application interface.
|
10
8
|
class CLI # rubocop:disable Metrics/ClassLength
|
9
|
+
# Exit codes
|
10
|
+
# @see https://man.openbsd.org/sysexits.3
|
11
|
+
EX_OK = 0
|
12
|
+
EX_USAGE = 64
|
13
|
+
EX_DATAERR = 65
|
14
|
+
EX_NOINPUT = 67
|
15
|
+
EX_SOFTWARE = 70
|
16
|
+
EX_CONFIG = 78
|
17
|
+
|
11
18
|
# Create a CLI that outputs to the specified logger.
|
12
19
|
#
|
13
20
|
# @param logger [SlimLint::Logger]
|
@@ -39,16 +46,16 @@ module SlimLint
|
|
39
46
|
|
40
47
|
if options[:help]
|
41
48
|
print_help(options)
|
42
|
-
|
49
|
+
EX_OK
|
43
50
|
elsif options[:version] || options[:verbose_version]
|
44
51
|
print_version(options)
|
45
|
-
|
52
|
+
EX_OK
|
46
53
|
elsif options[:show_linters]
|
47
54
|
print_available_linters
|
48
|
-
|
55
|
+
EX_OK
|
49
56
|
elsif options[:show_reporters]
|
50
57
|
print_available_reporters
|
51
|
-
|
58
|
+
EX_OK
|
52
59
|
else
|
53
60
|
scan_for_lints(options)
|
54
61
|
end
|
@@ -60,20 +67,20 @@ module SlimLint
|
|
60
67
|
case exception
|
61
68
|
when SlimLint::Exceptions::ConfigurationError
|
62
69
|
log.error exception.message
|
63
|
-
|
70
|
+
EX_CONFIG
|
64
71
|
when SlimLint::Exceptions::InvalidCLIOption
|
65
72
|
log.error exception.message
|
66
73
|
log.log "Run `#{APP_NAME}` --help for usage documentation"
|
67
|
-
|
74
|
+
EX_USAGE
|
68
75
|
when SlimLint::Exceptions::InvalidFilePath
|
69
76
|
log.error exception.message
|
70
|
-
|
77
|
+
EX_NOINPUT
|
71
78
|
when SlimLint::Exceptions::NoLintersError
|
72
79
|
log.error exception.message
|
73
|
-
|
80
|
+
EX_NOINPUT
|
74
81
|
else
|
75
82
|
print_unexpected_exception(exception)
|
76
|
-
|
83
|
+
EX_SOFTWARE
|
77
84
|
end
|
78
85
|
end
|
79
86
|
|
@@ -83,7 +90,7 @@ module SlimLint
|
|
83
90
|
def scan_for_lints(options)
|
84
91
|
report = Runner.new.run(options)
|
85
92
|
print_report(report, options)
|
86
|
-
report.failed? ?
|
93
|
+
report.failed? ? EX_DATAERR : EX_OK
|
87
94
|
end
|
88
95
|
|
89
96
|
# Outputs a report of the linter run using the specified reporter.
|
@@ -38,7 +38,7 @@ module SlimLint
|
|
38
38
|
#
|
39
39
|
# @param patterns [Array<String>]
|
40
40
|
# @return [Array<String>]
|
41
|
-
def extract_files_from(patterns) # rubocop:disable MethodLength
|
41
|
+
def extract_files_from(patterns) # rubocop:disable Metrics/MethodLength
|
42
42
|
files = []
|
43
43
|
|
44
44
|
patterns.each do |pattern|
|
data/lib/slim_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,49 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slim_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '10'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '13'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '10'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '13'
|
33
13
|
- !ruby/object:Gem::Dependency
|
34
14
|
name: rubocop
|
35
15
|
requirement: !ruby/object:Gem::Requirement
|
36
16
|
requirements:
|
37
17
|
- - ">="
|
38
18
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
19
|
+
version: 0.78.0
|
40
20
|
type: :runtime
|
41
21
|
prerelease: false
|
42
22
|
version_requirements: !ruby/object:Gem::Requirement
|
43
23
|
requirements:
|
44
24
|
- - ">="
|
45
25
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
26
|
+
version: 0.78.0
|
47
27
|
- !ruby/object:Gem::Dependency
|
48
28
|
name: slim
|
49
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,20 +44,6 @@ dependencies:
|
|
64
44
|
- - "<"
|
65
45
|
- !ruby/object:Gem::Version
|
66
46
|
version: '5.0'
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: sysexits
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '1.1'
|
74
|
-
type: :runtime
|
75
|
-
prerelease: false
|
76
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '1.1'
|
81
47
|
- !ruby/object:Gem::Dependency
|
82
48
|
name: rspec
|
83
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
155
|
- !ruby/object:Gem::Version
|
190
156
|
version: '0'
|
191
157
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.1.1
|
193
159
|
signing_key:
|
194
160
|
specification_version: 4
|
195
161
|
summary: Slim template linting tool
|