public class JavaScriptCheckVerifier extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.sonar.squidbridge.checks.CheckMessagesVerifier |
issues(JavaScriptCheck check,
File file)
Example:
|
static void |
verify(JavaScriptCheck check,
File file)
To use this message you should provide a comment on each line of the source file where you expect an issue.
|
public static org.sonar.squidbridge.checks.CheckMessagesVerifier issues(JavaScriptCheck check, File file)
JavaScriptCheckVerifier.issues(new MyCheck(), myFile))
.next().atLine(2).withMessage("This is message for line 2.")
.next().atLine(3).withMessage("This is message for line 3.").withCost(2.)
.next().atLine(8)
.noMore();
public static void verify(JavaScriptCheck check, File file)
var x = 1; // Noncompliant {{A message for this line.}}
function foo() { // Noncompliant [[effortToFix=2]] [[secondary=+0,+1]] [[sc=5;ec=6;el=+0]]
}
How to write these comments:
{{MESSAGE}} provide expected message.effortToFix keyword.sc, ec, el keywords respectively for start column, end column and end line.^ under each character of issue location.x = a && a; // Noncompliant // ^^
^ under each character of secondary issue location.
Start comment with "S" symbol and put after "^" ID of issue (specify it in double square brackets).
You can optionally provide message of secondary location.
x = a && a; // Noncompliant [[id=SomeID]]
//S ^^ SomeID {{secondary message}}
secondary keyword.+ or -.JavaScriptCheckVerifier.verify(new MyCheck(), myFile));
Copyright © 2011–2016 SonarSource and Eriks Nukis. All rights reserved.