aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Levé2018-06-28 10:25:22 +0200
committerElena Vilchik2018-06-28 10:25:22 +0200
commit3dfb3ea3d27ef143f992dc90faf6054d55953958 (patch)
tree48ae4dfd5df2975c93eb5df0553352aff28a3926
parent3006ae9acfe75609cd843c7017735f5584ec236b (diff)
downloadsonar-css-3dfb3ea3d27ef143f992dc90faf6054d55953958.tar.bz2
Update RSPEC metadata (#97)
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4652.html2
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4657.html2
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.html31
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.json2
-rw-r--r--sonarpedia.json4
5 files changed, 19 insertions, 22 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
index ae6f801..6864535 100644
--- 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
@@ -21,6 +21,6 @@ a {
</pre>
<h2>See</h2>
<ul>
- <li> https://www.w3.org/TR/CSS2/syndata.html#strings </li>
+ <li> <a href="https://www.w3.org/TR/CSS2/syndata.html#strings">CSS Specification</a> - Strings </li>
</ul>
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4657.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4657.html
index 4e9c92a..1b57deb 100644
--- a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4657.html
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4657.html
@@ -16,7 +16,7 @@ a {
</pre>
<h2>See</h2>
<ul>
- <li> <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties">Mozilla Web Technology for Developers</a> - shorthand
+ <li> <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties">Mozilla Web Technology for Developers</a> - Shorthand
properties </li>
</ul>
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.html
index 6f501e2..5064402 100644
--- a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.html
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.html
@@ -1,28 +1,25 @@
-<p>Order of instructions in CSS is important: instructions that occur last in the file take the priority. When a selector with high specificity (eg
-<code>#container a top: 10px; </code>) comes before the selector it overrides (eg: <code>a top: 0; </code>), the priority is given to the high
-specificity definition which violates the principle of the last instruction takes the priority. </p>
-<p>CSS are most legible when overriding selectors always come after the selectors they override. That way both mechanisms, source order and
-specificity, work together nicely.</p>
+<p>Order of instructions in CSS is important: instructions with equal specificity that occur later in the file take the priority. But when a selector
+with a higher specificity (e.g. <code>p a { color: green;}</code>) comes before the selector it overrides (e.g.: <code>a { color: green;}</code>), the
+priority is given to the first one. Even if it works properly, this is harder to anticipate the behaviour of the stylesheet while reading as it goes
+against the principle that the last instruction takes the priority.</p>
<h2>Noncompliant Code Example</h2>
<pre>
-b a {}
-a {}
-
+p a {
+ color: green;
+}
-@media print {
- #c a {}
- a {}
+a {
+ color: blue;
}
</pre>
<h2>Compliant Solution</h2>
<pre>
-a {}
-b a {}
-
+a {
+ color: blue;
+}
-@media print {
- a {}
- #c a {}
+p a {
+ color: green;
}
</pre>
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.json
index ebcea71..9e12c25 100644
--- a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.json
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4664.json
@@ -1,6 +1,6 @@
{
"title": "Selectors of lower specificity should come before overriding selectors of higher specificity",
- "type": "BUG",
+ "type": "CODE_SMELL",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
diff --git a/sonarpedia.json b/sonarpedia.json
index d7ce5e6..3258a0d 100644
--- a/sonarpedia.json
+++ b/sonarpedia.json
@@ -3,8 +3,8 @@
"languages": [
"CSS"
],
- "latest-update": "2018-06-26T15:59:44.207Z",
+ "latest-update": "2018-06-28T08:18:15.629Z",
"options": {
"no-language-in-filenames": true
}
-}
+} \ No newline at end of file