scss_lint_reporter_junit 0.1.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/scss_lint_reporter_junit.rb +30 -0
  3. metadata +46 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 844b545af19d4f5ca1e32ee4ca4d890d5b3ab8de
4
+ data.tar.gz: 645ef5d218284331f9d647349add3df4b0d28ed0
5
+ SHA512:
6
+ metadata.gz: 75c64ab0203c912bc4ba2499e16b75b431ad16c0c639c4316211e966bb185aa18f1e37ac53fe32c9c7689ba5f2612cda00d7958c5c04ed5021c251013030f42f
7
+ data.tar.gz: 3605919c8736a50113b40ab59662270c265b4a836ec27d90c60ea69c1e9a4a7705d6455296e9ff449c6e13cdc839dbe27ec16a52773b2ac49fddcb7b58cb7488
@@ -0,0 +1,30 @@
1
+ module SCSSLint
2
+ class Reporter::JUnitReporter < Reporter
3
+ def report_lints
4
+ results = lints.group_by(&:filename)
5
+ output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
6
+
7
+ output << "<testsuite name=\"scsslint\" failures=\"#{results.length}\">\n"
8
+ if !results.length
9
+ output << " <testcase name=\"Empty\"/>\n"
10
+ end
11
+ results.each do |file_name, errors|
12
+ output << " <testcase name=#{file_name.encode(xml: :attr)}>\n"
13
+ output << " <failure message=\"#{errors.length} SCSSLint Failure\">"
14
+
15
+ i = 1
16
+ errors.each do |error|
17
+ output << "#{i}. line #{error.location.line}, column #{error.location.column}-" \
18
+ "#{error.location.length}: [#{error.severity}] #{error.linter.name if error.linter}: "\
19
+ "#{error.description.encode(xml: :attr)}"
20
+ i += 1
21
+ end
22
+ output << "</failure>\n"
23
+ output << " </testcase>\n"
24
+ end
25
+ output << "</testsuite>\n"
26
+
27
+ output
28
+ end
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scss_lint_reporter_junit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Florian Eckerstorfer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem add a new formatter to the scss-lint which is compatible with
14
+ the jUnit standard.
15
+ email:
16
+ - florian@eckerstorfer.co
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/scss_lint_reporter_junit.rb
22
+ homepage: https://github.com/florianeckerstorfer/scss_lint_reporter_junit
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: 1.3.6
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.4.8
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Extend the scss-lint with a jUnit formatter
46
+ test_files: []