mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Merge branch 'master' into relative-path-html-report
# Conflicts: # CHANGELOG.md
This commit is contained in:
@@ -45,35 +45,60 @@ public struct HTMLReporter: Reporter {
|
||||
"<!doctype html>\n",
|
||||
"<html>\n",
|
||||
"\t<head>\n",
|
||||
"\t\t<title>Swiftlint Report</title>\n",
|
||||
"\t\t<style type='text/css'>\n",
|
||||
"\t\t<meta charset=\"utf-8\" />\n",
|
||||
"\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n",
|
||||
"\t\t\n",
|
||||
"\t\t<style type=\"text/css\">\n",
|
||||
"\t\t\tbody {\n",
|
||||
"\t\t\t\tfont-family: Arial, Helvetica, sans-serif;\n",
|
||||
"\t\t\t\tfont-size: 0.9rem;\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\t\t\n",
|
||||
"\t\t\ttable {\n",
|
||||
"\t\t\t\tborder: 1px solid gray;\n",
|
||||
"\t\t\t\tborder-collapse: collapse;\n",
|
||||
"\t\t\t\t-moz-box-shadow: 3px 3px 4px #AAA;\n",
|
||||
"\t\t\t\t-webkit-box-shadow: 3px 3px 4px #AAA;\n",
|
||||
"\t\t\t\tbox-shadow: 3px 3px 4px #AAA;\n",
|
||||
"\t\t\t\tvertical-align: top;\n",
|
||||
"\t\t\t\theight: 64px;\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\ttd, th {\n",
|
||||
"\t\t\t\n",
|
||||
"\t\t\ttd, th {\n",
|
||||
"\t\t\t\tborder: 1px solid #D3D3D3;\n",
|
||||
"\t\t\t\tpadding: 5px 10px 5px 10px;\n",
|
||||
"\t\t}\n",
|
||||
"\t\tth {\n",
|
||||
"\t\t\tborder-bottom: 1px solid gray;\n",
|
||||
"\t\t\tbackground-color: rgba(41,52,92,0.313);\n",
|
||||
"\t\t}\n",
|
||||
"\t\t.error, .warning {\n",
|
||||
"\t\t\tbackground-color: #f0f099;\n",
|
||||
"\t\t} .error{ color: #ff0000;}\n",
|
||||
"\t\t.warning { color: #b36b00;\n",
|
||||
"\t\t}\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\t\t\n",
|
||||
"\t\t\tth {\n",
|
||||
"\t\t\t\tborder-bottom: 1px solid gray;\n",
|
||||
"\t\t\t\tbackground-color: rgba(41,52,92,0.313);\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\t\t\n",
|
||||
"\t\t\t.error, .warning {\n",
|
||||
"\t\t\t\ttext-align: center;\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\t\t\n",
|
||||
"\t\t\t.error {\n",
|
||||
"\t\t\t\tbackground-color: #FF9D92;\n",
|
||||
"\t\t\t\tcolor: #7F0800;\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\t\t\n",
|
||||
"\t\t\t.warning {\n",
|
||||
"\t\t\t\tbackground-color: #FFF59E;\n",
|
||||
"\t\t\t\tcolor: #7F7000;\n",
|
||||
"\t\t\t}\n",
|
||||
"\t\t</style>\n",
|
||||
"\t\t\n",
|
||||
"\t\t<title>SwiftLint Report</title>\n",
|
||||
"\t</head>\n",
|
||||
"\t<body>\n",
|
||||
"\t\t<h1>Swiftlint Report</h1>\n",
|
||||
"\t\t<h1>SwiftLint Report</h1>\n",
|
||||
"\t\t\n",
|
||||
"\t\t<hr />\n",
|
||||
"\t\t\n",
|
||||
"\t\t<h2>Violations</h2>\n",
|
||||
"\t\t<table border=\"1\" style=\"vertical-align: top; height: 64px;\">\n",
|
||||
"\t\t\n",
|
||||
"\t\t<table>\n",
|
||||
"\t\t\t<thead>\n",
|
||||
"\t\t\t\t<tr>\n",
|
||||
"\t\t\t\t\t<th style=\"width: 60pt;\">\n",
|
||||
@@ -95,9 +120,12 @@ public struct HTMLReporter: Reporter {
|
||||
"\t\t\t</thead>\n",
|
||||
"\t\t\t<tbody>\n", rows, "\t\t\t</tbody>\n",
|
||||
"\t\t</table>\n",
|
||||
"\t\t\n",
|
||||
"\t\t<br/>\n",
|
||||
"\t\t\n",
|
||||
"\t\t<h2>Summary</h2>\n",
|
||||
"\t\t<table border=\"1\" style=\"vertical-align: top; height: 64px;\">\n",
|
||||
"\t\t\n",
|
||||
"\t\t<table>\n",
|
||||
"\t\t\t<tbody>\n",
|
||||
"\t\t\t\t<tr>\n",
|
||||
"\t\t\t\t\t<td>Total files with violations</td>\n",
|
||||
@@ -113,10 +141,14 @@ public struct HTMLReporter: Reporter {
|
||||
"\t\t\t\t</tr>\n",
|
||||
"\t\t\t</tbody>\n",
|
||||
"\t\t</table>\n",
|
||||
"\t\t\n",
|
||||
"\t\t<hr />\n",
|
||||
"\t\t<p>Created with <a href=\"https://github.com/realm/SwiftLint\">\n",
|
||||
"\t\t\t<b>Swiftlint</b>\n",
|
||||
"\t\t</a> ", swiftlintVersion, " on: ", dateString, "</p>\n",
|
||||
"\t\t\n",
|
||||
"\t\t<p>\n",
|
||||
"\t\t\tCreated with\n",
|
||||
"\t\t\t<a href=\"https://github.com/realm/SwiftLint\"><b>SwiftLint</b></a>\n",
|
||||
"\t\t\t", swiftlintVersion, " on ", dateString, "\n",
|
||||
"\t\t</p>\n",
|
||||
"\t</body>\n",
|
||||
"</html>"
|
||||
].joined()
|
||||
@@ -130,10 +162,10 @@ public struct HTMLReporter: Reporter {
|
||||
let character: Int = location.character ?? 0
|
||||
return [
|
||||
"\t\t\t\t<tr>\n",
|
||||
"\t\t\t\t\t<td align=\"right\">\(index)</td>\n",
|
||||
"\t\t\t\t\t<td style=\"text-align: right;\">\(index)</td>\n",
|
||||
"\t\t\t\t\t<td>", file, "</td>\n",
|
||||
"\t\t\t\t\t<td align=\"center\">\(line):\(character)</td>\n",
|
||||
"\t\t\t\t\t<td class=\'", severity.lowercased(), "\'>", severity, "</td>\n",
|
||||
"\t\t\t\t\t<td style=\"text-align: center;\">\(line):\(character)</td>\n",
|
||||
"\t\t\t\t\t<td class=\"", severity.lowercased(), "\">", severity, "</td>\n",
|
||||
"\t\t\t\t\t<td>\(violation.reason.escapedForXML())</td>\n",
|
||||
"\t\t\t\t</tr>\n"
|
||||
].joined()
|
||||
|
||||
Reference in New Issue
Block a user