Skip to content

Commit

Permalink
Fix #105 Support CSS Fonts Module Level 4 - font-variant-emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
racodond committed Apr 30, 2018
1 parent 862fd44 commit 4bee260
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public void test_ignore_scss_nested_properties() {

@Test
public void test_number_of_validated_properties() {
assertEquals(316, CheckTestUtils.getCommonTestFile("properties/css").listFiles().length);
assertEquals(316, CheckTestUtils.getCommonTestFile("properties/less").listFiles().length);
assertEquals(316, CheckTestUtils.getCommonTestFile("properties/scss").listFiles().length);
assertEquals(317, CheckTestUtils.getCommonTestFile("properties/css").listFiles().length);
assertEquals(317, CheckTestUtils.getCommonTestFile("properties/less").listFiles().length);
assertEquals(317, CheckTestUtils.getCommonTestFile("properties/scss").listFiles().length);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.mybox {
font-variant-emoji: inherit;
font-variant-emoji: auto;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: 0; /* Noncompliant {Update the invalid value of property "font-variant-emoji". Expected format: auto | none}! */
font-variant-emoji: 10px; /* Noncompliant */
font-variant-emoji: normal; /* Noncompliant */
font-variant-emoji: auto none; /* Noncompliant */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.mybox {
font-variant-emoji: inherit;
font-variant-emoji: auto;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: 0; /* Noncompliant {Update the invalid value of property "font-variant-emoji". Expected format: auto | none}! */
font-variant-emoji: 10px; /* Noncompliant */
font-variant-emoji: normal; /* Noncompliant */
font-variant-emoji: auto none; /* Noncompliant */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.mybox {
font-variant-emoji: inherit;
font-variant-emoji: auto;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: 0; /* Noncompliant {Update the invalid value of property "font-variant-emoji". Expected format: auto | none}! */
font-variant-emoji: 10px; /* Noncompliant */
font-variant-emoji: normal; /* Noncompliant */
font-variant-emoji: auto none; /* Noncompliant */
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public class StandardPropertyFactory {
FontVariantAlternates.class,
FontVariantCaps.class,
FontVariantEastAsian.class,
FontVariantEmoji.class,
FontVariantLigatures.class,
FontVariantNumeric.class,
FontVariantPosition.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* SonarQube CSS / SCSS / Less Analyzer
* Copyright (C) 2013-2017 David RACODON
* mailto: [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.css.model.property.standard;

import org.sonar.css.model.property.StandardProperty;
import org.sonar.css.model.property.validator.valueelement.IdentifierValidator;

public class FontVariantEmoji extends StandardProperty {

public FontVariantEmoji() {
setExperimental(true);
addLinks("https://drafts.csswg.org/css-fonts-4/#propdef-font-variant-emoji");
addValidators(new IdentifierValidator("auto", "text", "emoji"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ public void should_return_an_unknown_property_object() {

@Test
public void number_of_standard_properties() {
assertEquals(624, StandardPropertyFactory.getAll().size());
assertEquals(625, StandardPropertyFactory.getAll().size());
}

@Test
public void number_of_experimental_properties() {
assertEquals(
338,
339,
StandardPropertyFactory
.getAll()
.stream()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.mybox {
font-variant-emoji: inherit;
font-variant-emoji: auto;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: 0; /* Noncompliant {Update the invalid value of property "font-variant-emoji". Expected format: auto | none}! */
font-variant-emoji: 10px; /* Noncompliant */
font-variant-emoji: normal; /* Noncompliant */
font-variant-emoji: auto none; /* Noncompliant */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.mybox {
font-variant-emoji: inherit;
font-variant-emoji: auto;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: 0; /* Noncompliant {Update the invalid value of property "font-variant-emoji". Expected format: auto | none}! */
font-variant-emoji: 10px; /* Noncompliant */
font-variant-emoji: normal; /* Noncompliant */
font-variant-emoji: auto none; /* Noncompliant */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.mybox {
font-variant-emoji: inherit;
font-variant-emoji: auto;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: 0; /* Noncompliant {Update the invalid value of property "font-variant-emoji". Expected format: auto | none}! */
font-variant-emoji: 10px; /* Noncompliant */
font-variant-emoji: normal; /* Noncompliant */
font-variant-emoji: auto none; /* Noncompliant */
}
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,16 @@
11,
12,
],
'project:custom/common/properties/css/font-variant-emoji.css':[
2,
3,
4,
5,
6,
7,
8,
9,
],
'project:custom/common/properties/css/font-variant-position.css':[
2,
3,
Expand Down
3 changes: 3 additions & 0 deletions its/ruling/tests/src/test/expected/css-line-length.json
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,9 @@
'project:custom/common/properties/css/font-variant-caps.css':[
10,
],
'project:custom/common/properties/css/font-variant-emoji.css':[
6,
],
'project:custom/common/properties/css/font-variant-position.css':[
6,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,12 @@
11,
12,
],
'project:custom/common/properties/css/font-variant-emoji.css':[
6,
7,
8,
9,
],
'project:custom/common/properties/css/font-variant-position.css':[
6,
7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,16 @@
11,
12,
],
'project:custom/common/properties/less/font-variant-emoji.less':[
2,
3,
4,
5,
6,
7,
8,
9,
],
'project:custom/common/properties/less/font-variant-position.less':[
2,
3,
Expand Down
3 changes: 3 additions & 0 deletions its/ruling/tests/src/test/expected/less-line-length.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@
'project:custom/common/properties/less/font-variant-caps.less':[
10,
],
'project:custom/common/properties/less/font-variant-emoji.less':[
6,
],
'project:custom/common/properties/less/font-variant-position.less':[
6,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,12 @@
11,
12,
],
'project:custom/common/properties/less/font-variant-emoji.less':[
6,
7,
8,
9,
],
'project:custom/common/properties/less/font-variant-position.less':[
6,
7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,12 @@
11,
12,
],
'project:custom/common/properties/less/font-variant-emoji.less':[
6,
7,
8,
9,
],
'project:custom/common/properties/less/font-variant-position.less':[
6,
7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,16 @@
11,
12,
],
'project:custom/common/properties/scss/font-variant-emoji.scss':[
2,
3,
4,
5,
6,
7,
8,
9,
],
'project:custom/common/properties/scss/font-variant-position.scss':[
2,
3,
Expand Down
3 changes: 3 additions & 0 deletions its/ruling/tests/src/test/expected/scss-line-length.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@
'project:custom/common/properties/scss/font-variant-caps.scss':[
10,
],
'project:custom/common/properties/scss/font-variant-emoji.scss':[
6,
],
'project:custom/common/properties/scss/font-variant-position.scss':[
6,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,12 @@
11,
12,
],
'project:custom/common/properties/scss/font-variant-emoji.scss':[
6,
7,
8,
9,
],
'project:custom/common/properties/scss/font-variant-position.scss':[
6,
7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,12 @@
11,
12,
],
'project:custom/common/properties/scss/font-variant-emoji.scss':[
6,
7,
8,
9,
],
'project:custom/common/properties/scss/font-variant-position.scss':[
6,
7,
Expand Down

0 comments on commit 4bee260

Please sign in to comment.