rubocop-socketry 0.1.0 → 0.1.2

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: 445a5ee210147c4a5ff2fd64e9b9b652c05d8d367a5e22c6e021ad7ae32c9b0b
4
- data.tar.gz: 68a660ee1a45d210fd1aff0a1fd95b6111231e6e94b8d415fa480d7e804756a0
3
+ metadata.gz: bd9a6a737fa0bd9a1c5a345b97f80a3c5f7446989637a009d60dc75f2a8c8d27
4
+ data.tar.gz: 3b09366eebd423d6e6f7415d37f5611f1f9c150e4cc14bf10d0ef7ef7ba309d5
5
5
  SHA512:
6
- metadata.gz: 8c3386766d825b8fa057c71f8dc58ee484378f0ec47a3a6445705f0a7d6e03ea54c0595ad946a445651a6a7952a49c8b23d258465f047415c13a98558617bf63
7
- data.tar.gz: 4e20dfca038f92fd398fcf3d1dbf64fbab9d639de3c9dc86b41080f1dd231531fe5786338836c6a486544e745c1c7d8f90374a28db8996792e53c5ed3b80b034
6
+ metadata.gz: d730ded733718d3b8f467fd44f914178bc1ddb56d99527e1166e52264e58ff6ee2fd1918461a9e80dcd34efa0de6e099530706a4cc69bb2e1cd36041fd25695d
7
+ data.tar.gz: 44fd9c7673c2bac0e3ded94eb219dc5a707edc2e7fe89bba51e5a8d491c5f45558eff2837941eb3f86fd4ed406bced0057a8a3a35bd4dfba998b4bd7a22a477a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This is the default configuration file for rubocop-ioquatix.
4
+ # You can override any of these settings in your .rubocop.yml file.
5
+
6
+ Layout/ConsistentBlankLineIndentation:
7
+ Description: "Ensures that blank lines have the same indentation as the previous non-blank line."
8
+ Enabled: true
9
+ VersionAdded: "0.1.0"
@@ -53,6 +53,11 @@ module RuboCop
53
53
  processed_source.lines.each_with_index do |line, index|
54
54
  line_number = index + 1
55
55
 
56
+ unless delta = indentation_deltas[line_number]
57
+ # Skip this line (e.g., non-squiggly heredoc content):
58
+ next
59
+ end
60
+
56
61
  # Check blank lines for correct indentation:
57
62
  if line.strip.empty?
58
63
  expected_indentation = indentation(current_level)
@@ -69,8 +74,6 @@ module RuboCop
69
74
  end
70
75
  end
71
76
 
72
- # Apply indentation delta for this line:
73
- delta = indentation_deltas[line_number] || 0
74
77
  current_level += delta
75
78
  end
76
79
  end
@@ -99,6 +102,21 @@ module RuboCop
99
102
  deltas[location.line] += 1
100
103
  deltas[location.last_line] -= 1
101
104
  end
105
+ when :dstr
106
+ if location = node.location
107
+ if body = location.heredoc_body
108
+ if location.expression.source.start_with?("<<~")
109
+ # Squiggly heredoc - indentation is significant, add deltas
110
+ deltas[body.line] += 1
111
+ deltas[body.last_line] -= 1
112
+ else
113
+ # Non-squiggly heredoc - ignore indentation on these lines
114
+ (body.line..body.last_line).each do |line|
115
+ deltas[line] = nil
116
+ end
117
+ end
118
+ end
119
+ end
102
120
  end
103
121
 
104
122
  node.children.each do |child|
@@ -35,7 +35,7 @@ module RuboCop
35
35
  LintRoller::Rules.new(
36
36
  type: :path,
37
37
  config_format: :rubocop,
38
- value: Pathname.new(__dir__).join("../../../config/default.yml")
38
+ value: File.expand_path("config.yaml", __dir__),
39
39
  )
40
40
  end
41
41
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module RuboCop
7
7
  module Socketry
8
- VERSION = "0.1.0"
8
+ VERSION = "0.1.2"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-socketry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -72,6 +72,7 @@ extra_rdoc_files: []
72
72
  files:
73
73
  - agent.md
74
74
  - lib/rubocop/socketry.rb
75
+ - lib/rubocop/socketry/config.yaml
75
76
  - lib/rubocop/socketry/layout/consistent_blank_line_indentation.rb
76
77
  - lib/rubocop/socketry/plugin.rb
77
78
  - lib/rubocop/socketry/version.rb
metadata.gz.sig CHANGED
Binary file