slim_lint 0.18.0 → 0.19.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 986eec7f82b19dc099ffdc1b39569f7dfde2eb01243dbcebe7ad13d36366a566
4
- data.tar.gz: 1543d58c24572178d4bd0cfe025a350619fb9fd1a3a0407efa79b1b9ed830d1f
3
+ metadata.gz: 9f8981bc153e8cbdd0d0f3be73acfcbbc22cebcc536b5e868e21021551d6b51f
4
+ data.tar.gz: 27f4b83491d752017a65c82951ce8edfadd43a41c8ff7cd7b6d6a7ee8790b789
5
5
  SHA512:
6
- metadata.gz: 82d91f68c230e4e5af4a6b6c3d439dc06816fdce4e258e890bfedbcb2682b8987ee7eed1c41b6b2c0fda63370f25675152d0d4ac0a55287d2706b3b24af55b77
7
- data.tar.gz: c4c07a3f6623fba5162b1e9f9bcbf358b6dbc37e500916980289c3022f0627a41da8268406b90d4fb2d768324729d0129c1afd1a8d40990572d2fe87a799422b
6
+ metadata.gz: 69cd8f58ebc3d1950f8ce70a980db280eeaa1887de85dd2f1c5f507fc835b5016693d88bf3d995d82c377a40b210443595c38554485afcb22e96c74b47479d81
7
+ data.tar.gz: afc8b85309b1aec3532711b46fdd25c98e662ffa55879e1f295bff3aef96f949ce4ed041b343765a0f5f78de0d0a505704b5a4f93024a46954f0352207d5d3a0
@@ -42,13 +42,14 @@ 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
@@ -59,10 +60,9 @@ linters:
59
60
  - Layout/MultilineMethodCallIndentation
60
61
  - Layout/MultilineMethodDefinitionBraceLayout
61
62
  - Layout/MultilineOperationIndentation
62
- - Layout/TrailingBlankLines
63
+ - Layout/ParameterAlignment
64
+ - Layout/TrailingEmptyLines
63
65
  - Layout/TrailingWhitespace
64
- - Lint/BlockAlignment
65
- - Lint/EndAlignment
66
66
  - Lint/Void
67
67
  - Metrics/BlockLength
68
68
  - Metrics/BlockNesting
@@ -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.18.0'
5
+ VERSION = '0.19.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.18.0
4
+ version: 0.19.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: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2019-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.50.0
19
+ version: 0.77.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.50.0
26
+ version: 0.77.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slim
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,20 +44,6 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '5.0'
47
- - !ruby/object:Gem::Dependency
48
- name: sysexits
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.1'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '1.1'
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: rspec
63
49
  requirement: !ruby/object:Gem::Requirement