slim_lint 0.17.1 → 0.20.2

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: 3dd48c3e1a45c948a846d41cfb827edf6583b2ea2f6ec6394b728cd146ca5920
4
- data.tar.gz: f2549322c4ce335696404911b2bb9a2a84a28530b2c85e3b0be081ff40567043
3
+ metadata.gz: 12e6f287dec219087741642a7082ebb184b9ae49c658a69786eceb773f084ea5
4
+ data.tar.gz: 3b078c22d76cea859645319017edcaa0e7ddaf160566057d3fb2656130ba2605
5
5
  SHA512:
6
- metadata.gz: 675f31da28979f3568a3514724f22501a1d3643e82e34acdaf9c62420d40c697c107b787f6f616813c8e95239fefaea7c22dfb7e7961c88ed5640bff26d7d1cd
7
- data.tar.gz: bc9c10174d426163523db19d827adbdeb61496ccba4b6595c85bdd0d6cdc750bb4ce9ead1a0889b49a80e6862a351a672dae242f4d4190c19821e5f82694df32
6
+ metadata.gz: e952c0d0b0ceecad1762c3c3dd5d0d86a3954fdcb38978bf6b38c216a2b153cf2491d5823b84441bf56a23b983410b91b6ae6dfaecc147b90c874e02179a3363
7
+ data.tar.gz: b80f20753aed88a9b0a8a7dfc8caa5e003a7915018fba1a0b0d12a2edb565c2bc0be559306ba427d6376bbd5aa1a342ce407ffe199fb3380d39f11249c0c9e14
@@ -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/AlignArguments
46
- - Layout/AlignArray
47
- - Layout/AlignHash
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/IndentArray
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,18 +61,18 @@ linters:
59
61
  - Layout/MultilineMethodCallIndentation
60
62
  - Layout/MultilineMethodDefinitionBraceLayout
61
63
  - Layout/MultilineOperationIndentation
62
- - Layout/TrailingBlankLines
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
75
+ - Style/WhileUntilDo
74
76
  - Style/WhileUntilModifier
75
77
 
76
78
  Tab:
@@ -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
@@ -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
- Sysexits::EX_OK
49
+ EX_OK
43
50
  elsif options[:version] || options[:verbose_version]
44
51
  print_version(options)
45
- Sysexits::EX_OK
52
+ EX_OK
46
53
  elsif options[:show_linters]
47
54
  print_available_linters
48
- Sysexits::EX_OK
55
+ EX_OK
49
56
  elsif options[:show_reporters]
50
57
  print_available_reporters
51
- Sysexits::EX_OK
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
- Sysexits::EX_CONFIG
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
- Sysexits::EX_USAGE
74
+ EX_USAGE
68
75
  when SlimLint::Exceptions::InvalidFilePath
69
76
  log.error exception.message
70
- Sysexits::EX_NOINPUT
77
+ EX_NOINPUT
71
78
  when SlimLint::Exceptions::NoLintersError
72
79
  log.error exception.message
73
- Sysexits::EX_NOINPUT
80
+ EX_NOINPUT
74
81
  else
75
82
  print_unexpected_exception(exception)
76
- Sysexits::EX_SOFTWARE
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? ? Sysexits::EX_DATAERR : Sysexits::EX_OK
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|
@@ -9,7 +9,6 @@ module SlimLint
9
9
 
10
10
  on [:html, :tag, anything, [],
11
11
  [:slim, :output, anything, capture(:ruby, anything)]] do |sexp|
12
-
13
12
  # Fetch original Slim code that contains an element with a control statement.
14
13
  line = document.source_lines[sexp.line() - 1]
15
14
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module SlimLint
5
- VERSION = '0.17.1'
5
+ VERSION = '0.20.2'
6
6
  end
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.17.1
4
+ version: 0.20.2
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: 2019-08-18 00:00:00.000000000 Z
11
+ date: 2020-10-13 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.50.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.50.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.0.3
158
+ rubygems_version: 3.1.4
193
159
  signing_key:
194
160
  specification_version: 4
195
161
  summary: Slim template linting tool