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 +4 -4
- data/lib/haml_lint/reporter/github_reporter.rb +32 -0
- data/lib/haml_lint/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '092e548aae63e23d9c6a5c3c11087590219e52792459ee548a5802503e80f6ec'
|
4
|
+
data.tar.gz: 120a88fbfb5b78e5d08724dffc9c7cf22292e391633c780da94161295ea745e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/haml_lint/version.rb
CHANGED
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.
|
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-
|
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
|