slim_lint 0.16.1 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2842a9a431bac963edaae83a465b6a640d3288cf66b838421a4094a3007a03ee
4
- data.tar.gz: 4b1b81741ca8f4ff4394412ccdb2f44f2cc055d181f6202505f628d29e378dcb
3
+ metadata.gz: c46c0d7a658f450e3e00c0f5748acb512c8e19b06be92654c70640231a24658c
4
+ data.tar.gz: 4a53220961467310115ea4dd91242517a0bb13c549fd6035889ae3963adc779a
5
5
  SHA512:
6
- metadata.gz: ab20b9741a77c905a9bb0b875868f59bfea6c7759d468785821aa22dde159182d1087b7a566b17e080e7f544c4c0d43c97d367fcebdda8b6a9fb090fffb8b205
7
- data.tar.gz: 4bd99aac3d6d0393622a7b19d0d76d166acd44a5d240ae17468b64cf3d06e1c076169d1e8aa85e717717488adc26d3155849640d2cb5c88b919c4b7d93505b6c
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
- RedundantDiv:
28
- enabled: true
27
+ FileLength:
28
+ enabled: false
29
+ max: 300
29
30
 
30
31
  LineLength:
31
32
  enabled: true
32
33
  max: 80
33
34
 
34
- FileLength:
35
- enabled: false
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
@@ -23,8 +23,8 @@ module SlimLint
23
23
  def run(args)
24
24
  options = SlimLint::Options.new.parse(args)
25
25
  act_on_options(options)
26
- rescue StandardError => ex
27
- handle_exception(ex)
26
+ rescue StandardError => e
27
+ handle_exception(e)
28
28
  end
29
29
 
30
30
  private
@@ -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 => error
39
+ rescue Psych::SyntaxError, Errno::ENOENT => e
40
40
  raise SlimLint::Exceptions::ConfigurationError,
41
- "Unable to load configuration from '#{file}': #{error}",
42
- error.backtrace
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
@@ -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 => ex
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(ex.error,
38
- ex.file,
39
- ex.line,
40
- ex.lineno,
41
- ex.column)
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
@@ -18,6 +18,7 @@ module SlimLint
18
18
  line = line.sub(ruby, 'x')
19
19
 
20
20
  next if line =~ /[^ ] ==?<?>? [^ ]/
21
+
21
22
  report_lint(sexp, MESSAGE)
22
23
  end
23
24
  end
@@ -24,10 +24,10 @@ module SlimLint
24
24
  @options[:files] = args
25
25
 
26
26
  @options
27
- rescue OptionParser::InvalidOption => ex
27
+ rescue OptionParser::InvalidOption => e
28
28
  raise Exceptions::InvalidCLIOption,
29
- ex.message,
30
- ex.backtrace
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: RUBY_ENGINE,
29
- ruby_patchlevel: RUBY_PATCHLEVEL.to_s,
30
- ruby_platform: 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
 
@@ -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 => ex
56
- return [SlimLint::Lint.new(nil, file, ex.lineno, ex.error, :error)]
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|
@@ -10,6 +10,7 @@ module SlimLint
10
10
  # @param sexp [SlimLint::Sexp]
11
11
  def trigger_pattern_callbacks(sexp)
12
12
  return if on_start(sexp) == :stop
13
+
13
14
  traverse sexp
14
15
  end
15
16
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module SlimLint
5
- VERSION = '0.16.1'
5
+ VERSION = '0.17.0'
6
6
  end
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.16.1
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: 2018-09-07 00:00:00.000000000 Z
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.2.0
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
- rubyforge_project:
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