Css plugin prototype for sonar
Please check: https://github.com/SonarCommunity/sonar-css for the latest changes
OBSOLETE - Css plugin prototype for sonar
License: GNU Lesser General Public License v3.0
Css plugin prototype for sonar
Please check: https://github.com/SonarCommunity/sonar-css for the latest changes
Hi,
18:00:39.445 DEBUG - D:\Program Files (x86)\Jenkins\workspace\Modeling_NewMapbuilder_Design_Frontend_Sonar\Mysoft.MAP2.DynamicModeling.Web\Default_Old.csscan't be analysed. erro:Parse error at line 22 column 5 failed to match all of: whiteSpaces semiColon _ident rCurlyBracket ruleset statement
12: top: 0;
13: width: 100%;
14: height: 127px;
15: }
16: .Content
17: {
18: width: 100%;
19: position: absolute;
20: top: 127px;
21: bottom: 0px;
22: +height: expression(parentNode.clientHeight - 127 - 2);
^
23: border-top: 1px solid #898D92;
24: /background-color: rgb(226, 230, 235);/
25: }
26: .UserInfo
27: {
28: position: absolute;
29: top: 5px;
30: right: 10px;
31: }
32: .UserInfo a
Failed at rules:
/-whiteSpaces consumed from (21, 17) to (22, 4): "\r\n "
/-semiColon consumed from (21, 16) to (21, 16): ";"
/-supDeclaration consumed from (18, 5) to (21, 15): ..."olute;\r\n top: 127px;\r\n bottom: 0px"
| /-semiColon
| | /-_ident
| | /-ident
| | /-property
| +-declaration
+-supDeclaration consumed from (18, 5) to (22, 4): ..."\n top: 127px;\r\n bottom: 0px;\r\n "
/-block consumed from (17, 1) to (18, 4): "{\r\n "
| /-rCurlyBracket
+-block consumed from (17, 1) to (22, 4): ..."\n top: 127px;\r\n bottom: 0px;\r\n "
/-ruleset consumed from (16, 1) to (16, 10): ".Content\r\n"
+-ruleset consumed from (16, 1) to (22, 4): ..."\n top: 127px;\r\n bottom: 0px;\r\n "
/-statement
+-statement consumed from (16, 1) to (22, 4): ..."\n top: 127px;\r\n bottom: 0px;\r\n "
/-stylesheet consumed from (1, 1) to (15, 3): ..." width: 100%;\r\n height: 127px;\r\n}\r\n"
Hi,
I got the following error when parsing @charset "utf-8";
18:05:13.045 ERROR - Unable to parse file: D:\Refactoring_Test\test\01
test\test_css\mission-css.css
com.sonar.sslr.api.RecognitionException: Parse error at line 1 column 2 failed t
o match all of: whiteSpaces lBracket idSelector classSelector colon lBracket idS
elector classSelector colon _ident from to _num adjacentComb precededComb childC
omb lBracket idSelector classSelector colon _ident from to _num adjacentComb pre
cededComb childComb comma eof comma lCurlyBracket statement
1: ?@charset "utf-8";
^
Failed at rules:
/-whiteSpaces
/-ident consumed from (1, 1) to (1, 1): "?"
/-typeSelector
| /-lBracket
| /-attributeSelector
| +-idSelector
| +-classSelector
| | /-colon
| +-pseudo
| /-subS
+-typeSelector consumed from (1, 1) to (1, 1): "?"
/-simpleSelector
I read that this plugin is also able to find issues in *.scss files, but I can't figure out how to activate that feature.
Is it possible to analyse scss files with this plugin? What are the changes that have to be made?
I wouldn't mind if a specific setting would make this plugin only analyse scss files, and no longer analyse css. All our css files have already been changed to scss.
I ran into a peculiar execution error while analyzing a project.
(here the the full error stack trace)
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:90)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:41)
Caused by: org.sonar.squid.api.AnalysisException: Unable to analyze file: /path/to/project/base.css
at com.sonar.sslr.squid.AstScanner.scanFiles(AstScanner.java:123)
at org.sonar.plugins.css.CssSquidSensor.analyse(CssSquidSensor.java:82)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:190)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:185)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:178)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:58)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:155)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:143)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
Caused by: java.lang.NullPointerException
at org.sonar.css.checks.BewareOfBoxModel.visitNode(BewareOfBoxModel.java:70)
at com.sonar.sslr.impl.ast.AstWalker.visitNode(AstWalker.java:114)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:85)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:69)
at com.sonar.sslr.squid.AstScanner.scanFiles(AstScanner.java:102)
... 37 more
after poking around a bit, I was able to work-around the issue by renaming my file (from base.css to not-base.css). by doing this, not-base.css was no longer the first file to the parsed.
after doing some more inspection, the very first rule in that file was an @font-face rule. commenting out the rule and putting the file back to its original name (base.css) also avoided the error. or if I placed a "traditional" selecting (ie: .test: {color: red}
) as the very first rule in the file, the error was also avoided.
It would be neat if there was a configurable property to input filename patterns we want to skip.
this would be particularly useful for CSS libraries that are already minified . so it would be cool to say "skip anything with .min.css or -min.css"
Got the following error:
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Parse error at line 7765 column 29 failed to match all of: _ident lParenthesis lBracket _num _num _string uri hash unicodeRange includes dashMatch _ident _num colon important delim lCurlyBracket atkeyword semiColon _ident rCurlyBracket ruleset
when parsing the following style:
.visible-desktop {
display: none !important ;
}
Notice that there is a space between !important
and the semicolon.
When I have several declarations inside a media query, and those different declarations contain the same properties, an violation is created. In the example below the second border-color
is marked as a duplicate property.
@media (min-width: 320px) {
.box1 {
border-color: orange;
}
.box2 {
border-color: orangered;
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.