a11y-lint 0.7.0 → 0.7.1

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: db05eea43ab0509e04c90f7e2942ddc272ad5d3e8894aec3ee9a3ddb477a70e0
4
- data.tar.gz: 729f6b3a082105a85b8718293e7c9c9a49d8917ac02ffb554c190973f97ff173
3
+ metadata.gz: 6fe6daf54c27923c7bb8d7c200baab018d5643ae6d17f1da3116b90b8b9a9b1a
4
+ data.tar.gz: 866c2a9cdbeddc1d8b4c726e89a104b4b193070fb52ec1ae45c6552fee41afe1
5
5
  SHA512:
6
- metadata.gz: e55e705c0496c85e98f99e0ff680530a347db33aeb4b4351b318d8f9bfd9273908a8a92750606253556512c80c7ef02d41a55a8abd0c7857c4f21df70adc903a
7
- data.tar.gz: dda39aeac2ca75ac9b6cf5c2afd5283f318a5b6c7de2e0470d65216cc5c7f0942d2e243e2703c58a8efd62fe685697252041a436d3e56a5af698a1849aabf1e1
6
+ metadata.gz: 1d07bed9bdc71ef0d08f6aa097c5c2550988c11899106e0ceeaaaf54a2c5243449842dd20390b321fdbbcf54811bc53a1487cbb502ac75698224dec99e13599c
7
+ data.tar.gz: a7ef305af11a87604e4f95ca3cfd62afa7c142601d9c081ec2448747414fef7ae32a11020134cebaddb4954c788eec5688251d18332d7079d8b531f98015ab6f
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.7.1] - 2026-04-13
11
+
12
+ ### Fixed
13
+
14
+ - Slim runner: correct line numbers in templates with multiline backslash continuations
15
+
8
16
  ## [0.7.0] - 2026-04-13
9
17
 
10
18
  ### Added
@@ -27,6 +27,7 @@ module A11y
27
27
  @line += 1 if sexp[0] == :newline
28
28
  new_node = Node.new(sexp, line: @line)
29
29
  check_node(new_node) if html_tag?(sexp) || slim_output?(sexp)
30
+ @line += continuation_newlines(sexp)
30
31
  sexp.each { |child| walk(child) }
31
32
  end
32
33
 
@@ -38,6 +39,19 @@ module A11y
38
39
  sexp[0] == :slim && sexp[1] == :output
39
40
  end
40
41
 
42
+ # Counts extra source lines consumed by backslash-continued
43
+ # multiline expressions in :output and :control nodes.
44
+ # Slim collapses these into one AST node whose ruby_code
45
+ # string retains the original newlines.
46
+ def continuation_newlines(sexp)
47
+ code = case sexp
48
+ in [:slim, :output, _, String => c, *] then c
49
+ in [:slim, :control, String => c, *] then c
50
+ else return 0
51
+ end
52
+ code.count("\n")
53
+ end
54
+
41
55
  def node?(sexp)
42
56
  sexp.is_a?(Array) && !sexp.empty? && sexp[0].is_a?(Symbol)
43
57
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module A11y
4
4
  module Lint
5
- VERSION = "0.7.0"
5
+ VERSION = "0.7.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a11y-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdullah Hashim