haml_lint 0.56.0 → 0.57.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: b0bb69db6857a5c9b072203e93e4c9964bd60a9f8e4f1024e4db31453deec8a6
4
- data.tar.gz: 94fcce12ae043e72f638d532fcddccfad2de1c8af33a261c37920fa738c4609e
3
+ metadata.gz: '092e548aae63e23d9c6a5c3c11087590219e52792459ee548a5802503e80f6ec'
4
+ data.tar.gz: 120a88fbfb5b78e5d08724dffc9c7cf22292e391633c780da94161295ea745e0
5
5
  SHA512:
6
- metadata.gz: 973dd46634cfde27066acfcd5d44bebc538716f7ca0d34114b183c19808513fc397b688a66664f6bf1b5ae0367762d4daa7f203d894cd3eb068bcbcfdc12edc5
7
- data.tar.gz: ac57887f196f37a3f2f40b77cc5c1e24dd2b29bc29a9d693fc4a675a69ced56f4a49386e2e7a8694cfa04ecbb3ac75bb4fb412c760a0a9fe83d2d20b7bdef40a
6
+ metadata.gz: 5123d876bb4b79d4fbf14fae8acef295993c909baaee63975f899571fe450cf67f503c761b2628ddb96874f39a4be51a8c489ddb94a87eb95034e3a05ba44431
7
+ data.tar.gz: 152d02d1daa2f51e9c0ddca5602d74642b324e860daa33aeec715ff4e2be297054abaf0d35dd9d15cfafcf15955bfce48823575643b18c4375707f172621eb66
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: false
2
+
3
+ module HamlLint
4
+ # Outputs GitHub workflow commands for GitHub check annotations when run within GitHub actions.
5
+ class Reporter::GithubReporter < Reporter
6
+ ESCAPE_MAP = { '%' => '%25', "\n" => '%0A', "\r" => '%0D' }.freeze
7
+
8
+ include Reporter::Utils
9
+
10
+ def added_lint(lint, report)
11
+ if lint.severity >= report.fail_level
12
+ print_workflow_command(lint: lint)
13
+ else
14
+ print_workflow_command(severity: 'warning', lint: lint)
15
+ end
16
+ end
17
+
18
+ def display_report(report)
19
+ print_summary(report)
20
+ end
21
+
22
+ private
23
+
24
+ def print_workflow_command(lint:, severity: 'error')
25
+ log.log "::#{severity} file=#{lint.filename},line=#{lint.line}::#{github_escape(lint.message)}"
26
+ end
27
+
28
+ def github_escape(string)
29
+ string.gsub(Regexp.union(ESCAPE_MAP.keys), ESCAPE_MAP)
30
+ end
31
+ end
32
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.56.0'
5
+ VERSION = '0.57.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.0
4
+ version: 0.57.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: 2024-02-04 00:00:00.000000000 Z
11
+ date: 2024-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
@@ -153,6 +153,7 @@ files:
153
153
  - lib/haml_lint/reporter/checkstyle_reporter.rb
154
154
  - lib/haml_lint/reporter/default_reporter.rb
155
155
  - lib/haml_lint/reporter/disabled_config_reporter.rb
156
+ - lib/haml_lint/reporter/github_reporter.rb
156
157
  - lib/haml_lint/reporter/hash_reporter.rb
157
158
  - lib/haml_lint/reporter/hooks.rb
158
159
  - lib/haml_lint/reporter/json_reporter.rb