sonar-css-plugin
sonar-css-plugin copied to clipboard
Problem with rule unknown-less-functions
I started using this plugin and i see that it found an issue with "extend" function
.maine-layout--selected:extend(.maine-layout) {
color: @text-color-grey;
.status-new, .status-old, .status-ignore {
color: @text-color-grey;
}
}
but it doesnt see problem with
.client-library__some-data {
&:extend(.client-list__some-data);
}
from what i read, extend is less function from some time http://lesscss.org/features/#extend-feature
Hi,
Which version of the plugin are you running?
David
right now version 4.14
Hi,
I cannot reproduce the issue. Could you please provide the entire file as well a screenshot of the issue?
Thank you
David
Hello @racodond, I wrote a code which allows to reproduce the error:
The file is compiled successfully.
Environment:
- CSS / SCSS / Less plugin: 4.15
- SonarQube: 7.0
Example file: https://github.com/agabrys/sonarqube-falsepositives/blob/master/src/main/less/d20180410/unknown-less-functions.less
Project: https://github.com/agabrys/sonarqube-falsepositives
Build: mvn clean package sonar
Best Regards
Thanks for the reproducer @agabrys!
It's a tricky bug related to at-rule parsing. The violation here is a side-effect from that parsing issue.
keyword: @media
prelude:
(max-width: 768px) {
.navtab-info--dates {
padding-left: 1%;
}
}
.customization-form__variation-data, .customization-form__variation-menu {
display: inline-block;
}
.client-library__some-data {
&:extend(.client-list__some-data);
}
.variation-layout--selected:extend(.variation-layout) {
color: #000;
.status-active, .status-inactive, .status-ignore {
color: #000;
}
}
block: none
instead of
keyword: @media
prelude: (max-width: 768px)
block:
{
.navtab-info--dates {
padding-left: 1%;
}
}
.customization-form__variation-data, .customization-form__variation-menu {
display: inline-block;
}
.client-library__some-data {
&:extend(.client-list__some-data);
}
.variation-layout--selected:extend(.variation-layout) {
color: #000;
.status-active, .status-inactive, .status-ignore {
color: #000;
}
}