-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update S4649 ('font-family-no-missing-generic-family-keyword'): Support 'ignoreFontFamilies' option #3095
Conversation
…rt 'ignoreFontFamilies' option
|
||
@Rule(key = "S4649") | ||
public class FontFamilyNoMissingGenericFamilyKeyword implements CssRule { | ||
|
||
private static final String DEFAULT_IGNORE_FONT_FAMILIES = "custom-font"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not put example into default value
|
||
@RuleProperty( | ||
key = "ignoreFontFamilies", | ||
description = "Comma-separated list of regular expressions for font families exempt from this rule.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As not only regex are support but also plain strings I would rephrase: Comma-separated list of font families exempt from this rule (regular expressions supported).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove default value
@@ -142,7 +142,7 @@ void declaration_block_no_duplicate_properties_custom() { | |||
@Test | |||
void font_family_no_missing_generic_family_keyword_default() { | |||
String optionsAsJson = new Gson().toJson(new FontFamilyNoMissingGenericFamilyKeyword().stylelintOptions()); | |||
assertThat(optionsAsJson).isEqualTo("[true,{\"ignoreFontFamilies\":[\"custom-font\"]}]"); | |||
assertThat(optionsAsJson).isEqualTo("[true,{\"ignoreFontFamilies\":[\"\"]}]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm.. usually we have non-empty default, so we didn't have such problem before, but I believe we should have an empty array here, and not array with empty string literal.
SonarQube Quality Gate |
@vilchik-elena I am using SonarQube 9.4 and I can still see this issue Please can you let me know if this update is available in version 9.4? |
@farashaikh this change only adds a parameter for the rule. You should set it to the values you need. |
Fixes https://github.com/SonarSource/sonar-css/issues/356
Fixes SonarSource/sonar-css#357