slim_lint 0.16.1 → 0.17.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 +4 -4
- data/config/default.yml +11 -9
- data/lib/slim_lint/cli.rb +2 -2
- data/lib/slim_lint/configuration_loader.rb +3 -3
- data/lib/slim_lint/engine.rb +6 -6
- data/lib/slim_lint/linter/control_statement_spacing.rb +1 -0
- data/lib/slim_lint/options.rb +3 -3
- data/lib/slim_lint/reporter/json_reporter.rb +3 -3
- data/lib/slim_lint/runner.rb +2 -2
- data/lib/slim_lint/sexp_visitor.rb +1 -0
- data/lib/slim_lint/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c46c0d7a658f450e3e00c0f5748acb512c8e19b06be92654c70640231a24658c
|
4
|
+
data.tar.gz: 4a53220961467310115ea4dd91242517a0bb13c549fd6035889ae3963adc779a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd248063a6e41b9c25f29ecfcf8dbdd370cf0974217158f1c7be7e5d1989ad9861c3a6fd266b18bb6f4756698386580ab6c2f0ba746337d2edd989809e96641e
|
7
|
+
data.tar.gz: f7735d7db2b0be57b832b0399b617a53709dda7c3e6c1ddc0eb3b9c1b58eea0619acc0cd93c8a12cf3c40b9d6916f096f6b18ae6c56fa2f8e91e9ec59321c127
|
data/config/default.yml
CHANGED
@@ -11,29 +11,29 @@ linters:
|
|
11
11
|
CommentControlStatement:
|
12
12
|
enabled: true
|
13
13
|
|
14
|
-
ControlStatementSpacing:
|
15
|
-
enabled: true
|
16
|
-
|
17
14
|
ConsecutiveControlStatements:
|
18
15
|
enabled: true
|
19
16
|
max_consecutive: 2
|
20
17
|
|
18
|
+
ControlStatementSpacing:
|
19
|
+
enabled: true
|
20
|
+
|
21
21
|
EmptyControlStatement:
|
22
22
|
enabled: true
|
23
23
|
|
24
24
|
EmptyLines:
|
25
25
|
enabled: true
|
26
26
|
|
27
|
-
|
28
|
-
enabled:
|
27
|
+
FileLength:
|
28
|
+
enabled: false
|
29
|
+
max: 300
|
29
30
|
|
30
31
|
LineLength:
|
31
32
|
enabled: true
|
32
33
|
max: 80
|
33
34
|
|
34
|
-
|
35
|
-
enabled:
|
36
|
-
max: 300
|
35
|
+
RedundantDiv:
|
36
|
+
enabled: true
|
37
37
|
|
38
38
|
RuboCop:
|
39
39
|
enabled: true
|
@@ -42,13 +42,16 @@ 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/AlignArguments
|
45
46
|
- Layout/AlignArray
|
46
47
|
- Layout/AlignHash
|
47
48
|
- Layout/AlignParameters
|
49
|
+
- Layout/EmptyLineAfterGuardClause
|
48
50
|
- Layout/FirstParameterIndentation
|
49
51
|
- Layout/IndentArray
|
50
52
|
- Layout/IndentationConsistency
|
51
53
|
- Layout/IndentationWidth
|
54
|
+
- Layout/InitialIndentation
|
52
55
|
- Layout/MultilineArrayBraceLayout
|
53
56
|
- Layout/MultilineAssignmentLayout
|
54
57
|
- Layout/MultilineHashBraceLayout
|
@@ -65,7 +68,6 @@ linters:
|
|
65
68
|
- Metrics/BlockNesting
|
66
69
|
- Metrics/LineLength
|
67
70
|
- Naming/FileName
|
68
|
-
- Style/EmptyLineAfterGuardClause
|
69
71
|
- Style/FrozenStringLiteralComment
|
70
72
|
- Style/IfUnlessModifier
|
71
73
|
- Style/Next
|
data/lib/slim_lint/cli.rb
CHANGED
@@ -36,10 +36,10 @@ module SlimLint
|
|
36
36
|
config = load_from_file(file)
|
37
37
|
|
38
38
|
default_configuration.merge(config)
|
39
|
-
rescue Psych::SyntaxError, Errno::ENOENT =>
|
39
|
+
rescue Psych::SyntaxError, Errno::ENOENT => e
|
40
40
|
raise SlimLint::Exceptions::ConfigurationError,
|
41
|
-
"Unable to load configuration from '#{file}': #{
|
42
|
-
|
41
|
+
"Unable to load configuration from '#{file}': #{e}",
|
42
|
+
e.backtrace
|
43
43
|
end
|
44
44
|
|
45
45
|
# Creates a configuration from the specified hash, ensuring it extends the
|
data/lib/slim_lint/engine.rb
CHANGED
@@ -32,13 +32,13 @@ module SlimLint
|
|
32
32
|
# @return [SlimLint::Sexp] parsed Sexp
|
33
33
|
def parse(source)
|
34
34
|
call(source)
|
35
|
-
rescue ::Slim::Parser::SyntaxError =>
|
35
|
+
rescue ::Slim::Parser::SyntaxError => e
|
36
36
|
# Convert to our own exception type to isolate from upstream changes
|
37
|
-
error = SlimLint::Exceptions::ParseError.new(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
error = SlimLint::Exceptions::ParseError.new(e.error,
|
38
|
+
e.file,
|
39
|
+
e.line,
|
40
|
+
e.lineno,
|
41
|
+
e.column)
|
42
42
|
raise error
|
43
43
|
end
|
44
44
|
end
|
data/lib/slim_lint/options.rb
CHANGED
@@ -24,10 +24,10 @@ module SlimLint
|
|
24
24
|
@options[:files] = args
|
25
25
|
|
26
26
|
@options
|
27
|
-
rescue OptionParser::InvalidOption =>
|
27
|
+
rescue OptionParser::InvalidOption => e
|
28
28
|
raise Exceptions::InvalidCLIOption,
|
29
|
-
|
30
|
-
|
29
|
+
e.message,
|
30
|
+
e.backtrace
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
@@ -25,9 +25,9 @@ module SlimLint
|
|
25
25
|
def metadata
|
26
26
|
{
|
27
27
|
slim_lint_version: SlimLint::VERSION,
|
28
|
-
ruby_engine:
|
29
|
-
ruby_patchlevel:
|
30
|
-
ruby_platform:
|
28
|
+
ruby_engine: RUBY_ENGINE,
|
29
|
+
ruby_patchlevel: RUBY_PATCHLEVEL.to_s,
|
30
|
+
ruby_platform: RUBY_PLATFORM,
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
data/lib/slim_lint/runner.rb
CHANGED
@@ -52,8 +52,8 @@ module SlimLint
|
|
52
52
|
def collect_lints(file, linter_selector, config)
|
53
53
|
begin
|
54
54
|
document = SlimLint::Document.new(File.read(file), file: file, config: config)
|
55
|
-
rescue SlimLint::Exceptions::ParseError =>
|
56
|
-
return [SlimLint::Lint.new(nil, file,
|
55
|
+
rescue SlimLint::Exceptions::ParseError => e
|
56
|
+
return [SlimLint::Lint.new(nil, file, e.lineno, e.error, :error)]
|
57
57
|
end
|
58
58
|
|
59
59
|
linter_selector.linters_for_file(file).map do |linter|
|
data/lib/slim_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slim_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
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: 2019-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -182,15 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
182
|
requirements:
|
183
183
|
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: 2.
|
185
|
+
version: 2.4.0
|
186
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
187
|
requirements:
|
188
188
|
- - ">="
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
|
-
|
193
|
-
rubygems_version: 2.7.6
|
192
|
+
rubygems_version: 3.0.3
|
194
193
|
signing_key:
|
195
194
|
specification_version: 4
|
196
195
|
summary: Slim template linting tool
|