aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-css-plugin/src/main/resources
diff options
context:
space:
mode:
authorAmaury Levé2018-06-26 15:22:10 +0200
committerElena Vilchik2018-06-26 17:12:59 +0200
commit5aaa1f182736f84f1613aa60f3f7da37103167c2 (patch)
treec614d8b0297d34d40af8823bc11a1deba6ffb4a2 /sonar-css-plugin/src/main/resources
parentee58ae41cf30e31f58555e2d736ade59559e7987 (diff)
downloadsonar-css-5aaa1f182736f84f1613aa60f3f7da37103167c2.tar.bz2
Rule S4650: 'calc' members should be correctly spaced or indented
Diffstat (limited to 'sonar-css-plugin/src/main/resources')
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.html19
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.json16
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json1
3 files changed, 36 insertions, 0 deletions
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.html
new file mode 100644
index 0000000..adca17a
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.html
@@ -0,0 +1,19 @@
+<p><code>calc</code> is a CSS3 function that provides the possibility to do simple math in CSS (add, subtract, divide, multiply). Without spaces
+around operators, <code>calc</code> will have no effect.</p>
+<p>More precisely, before an operator, there must be a single whitespace or a newline plus indentation. After an operator, there must be a single
+whitespace or a newline.</p>
+<h2>Noncompliant Code Example</h2>
+<pre>
+#div1 {
+ position: absolute;
+ width: calc(100%- 100px); // Noncompliant; no space after the % sign
+}
+</pre>
+<h2>Compliant Solution</h2>
+<pre>
+#div1 {
+ position: absolute;
+ width: calc(100% - 100px);
+}
+</pre>
+
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.json
new file mode 100644
index 0000000..5720374
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4650.json
@@ -0,0 +1,16 @@
+{
+ "title": "\"calc\" members should be correctly spaced or indented",
+ "type": "BUG",
+ "status": "ready",
+ "remediation": {
+ "func": "Constant\/Issue",
+ "constantCost": "1min"
+ },
+ "tags": [
+
+ ],
+ "defaultSeverity": "Blocker",
+ "ruleSpecification": "RSPEC-4650",
+ "sqKey": "S4650",
+ "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 4fe2a7a..adbe829 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
@@ -6,6 +6,7 @@
"S4647",
"S4648",
"S4649",
+ "S4650",
"S4651",
"S4652",
"S4653",