From 9bcc46b342cfb888f16c180cb0b3103335def5f1 Mon Sep 17 00:00:00 2001 From: Amaury Levé Date: Thu, 21 Jun 2018 14:55:09 +0200 Subject: Rule S4653: Units should be valid (#50) --- .../org/sonar/l10n/css/rules/css/S4653.html | 20 ++++++++++++++++++++ .../org/sonar/l10n/css/rules/css/S4653.json | 16 ++++++++++++++++ .../sonar/l10n/css/rules/css/Sonar_way_profile.json | 3 ++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.html create mode 100644 sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.json (limited to 'sonar-css-plugin/src/main/resources/org') diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.html new file mode 100644 index 0000000..283bf5d --- /dev/null +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.html @@ -0,0 +1,20 @@ +

The W3C specifications define the units that can be used with lengths. A unit that is not part of the list of supported ones is likely +to be a typo and will be seen as a UI bug by the user.

+

This rule raises an issue each time a unit is not officially supported.

+

Noncompliant Code Example

+
+a {
+  width: 10pixels;
+}
+
+

Compliant Solution

+
+a {
+  width: 10px;
+}
+
+

See

+ + diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.json new file mode 100644 index 0000000..b6ee0e2 --- /dev/null +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4653.json @@ -0,0 +1,16 @@ +{ + "title": "Units should be valid", + "type": "BUG", + "status": "ready", + "remediation": { + "func": "Constant\/Issue", + "constantCost": "5min" + }, + "tags": [ + + ], + "defaultSeverity": "Blocker", + "ruleSpecification": "RSPEC-4653", + "sqKey": "S4653", + "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 ba5ce46..a0e81bb 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 @@ -1,6 +1,7 @@ { "name": "Sonar way", "ruleKeys": [ - "S4647" + "S4647", + "S4653" ] } -- cgit v1.2.3