aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-css-plugin/src/main/resources/org
diff options
context:
space:
mode:
authorAmaury Levé2018-06-21 17:11:48 +0200
committerGitHub2018-06-21 17:11:48 +0200
commitfb06e0a88b47fe8505b87dbbf88aad47e9b300e2 (patch)
tree60a14fc3f7d02f13018287d10dd14dc786609971 /sonar-css-plugin/src/main/resources/org
parent7a2daa058f3da99a224a2c874e554f88d2ad8104 (diff)
downloadsonar-css-fb06e0a88b47fe8505b87dbbf88aad47e9b300e2.tar.bz2
Rule S4652: Strings should not contain new lines (#57)
Diffstat (limited to 'sonar-css-plugin/src/main/resources/org')
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.html26
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.json16
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json3
3 files changed, 44 insertions, 1 deletions
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.html
new file mode 100644
index 0000000..ae6f801
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.html
@@ -0,0 +1,26 @@
+<p>According to the W3C specifications:</p>
+<blockquote>
+ <p>A string cannot directly contain a newline. To include a newline in a string, use an escape representing the line feed character in ISO-10646
+ (U+000A), such as "\A" or "\00000a".</p>
+ <p>[...]</p>
+ <p>It is possible to break strings over several lines, for aesthetic or other reasons, but in such a case the newline itself has to be escaped with
+ a backslash (\).</p>
+</blockquote>
+<h2>Noncompliant Code Example</h2>
+<pre>
+a {
+ content: "first
+ second";
+}
+</pre>
+<h2>Compliant Solution</h2>
+<pre>
+a {
+ content: "first\Asecond";
+}
+</pre>
+<h2>See</h2>
+<ul>
+ <li> https://www.w3.org/TR/CSS2/syndata.html#strings </li>
+</ul>
+
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.json
new file mode 100644
index 0000000..06dcd4d
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.json
@@ -0,0 +1,16 @@
+{
+ "title": "Strings should not contain new lines",
+ "type": "CODE_SMELL",
+ "status": "ready",
+ "remediation": {
+ "func": "Constant\/Issue",
+ "constantCost": "1min"
+ },
+ "tags": [
+
+ ],
+ "defaultSeverity": "Major",
+ "ruleSpecification": "RSPEC-4652",
+ "sqKey": "S4652",
+ "scope": "Main"
+}
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json
index f7ce787..68da351 100644
--- a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json
@@ -2,7 +2,8 @@
"name": "Sonar way",
"ruleKeys": [
"S4647",
+ "S4652",
"S4653",
"S4663"
]
-}
+}