Package org.sonar.python.checks
Class AbstractStringFormatCheck
- java.lang.Object
-
- org.sonar.plugins.python.api.PythonSubscriptionCheck
-
- org.sonar.python.checks.AbstractStringFormatCheck
-
- All Implemented Interfaces:
PythonCheck,SubscriptionCheck
- Direct Known Subclasses:
StringFormatCorrectnessCheck,StringFormatMisuseCheck
public abstract class AbstractStringFormatCheck extends PythonSubscriptionCheck
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.PythonCheck
PythonCheck.PreciseIssue
-
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.SubscriptionCheck
SubscriptionCheck.Context
-
-
Field Summary
Fields Modifier and Type Field Description protected static Consumer<String>IGNORE_SYNTAX_ERRORS
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractStringFormatCheck()
-
Method Summary
-
Methods inherited from class org.sonar.plugins.python.api.PythonSubscriptionCheck
leaveFile, scanFile
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sonar.plugins.python.api.SubscriptionCheck
initialize
-
-
-
-
Method Detail
-
checkPrintfStyle
protected void checkPrintfStyle(SubscriptionContext ctx)
-
checkPrintfStyle
protected abstract void checkPrintfStyle(SubscriptionContext ctx, BinaryExpression modulo, StringLiteral literal)
-
checkPrintfDictionary
protected static void checkPrintfDictionary(SubscriptionContext ctx, StringFormat format, DictionaryLiteral dict)
-
checkPrintfExpressionList
protected static void checkPrintfExpressionList(SubscriptionContext ctx, StringFormat format, Token locFrom, Token locTo, List<Expression> expressions)
-
checkStrFormatStyle
protected void checkStrFormatStyle(SubscriptionContext ctx)
-
checkStrFormatStyle
protected abstract void checkStrFormatStyle(SubscriptionContext ctx, CallExpression callExpression, Expression qualifier, StringLiteral literal)
-
isQualifiedCallToStrFormat
protected static boolean isQualifiedCallToStrFormat(CallExpression callExpression)
-
syntaxIssueReporter
protected static Consumer<String> syntaxIssueReporter(SubscriptionContext ctx, Tree primary, Tree secondary)
-
reportIssue
protected static void reportIssue(SubscriptionContext ctx, Tree primary, Tree secondary, String message)
-
reportInvalidArgumentSize
protected static void reportInvalidArgumentSize(SubscriptionContext ctx, Token locFrom, Token locTo, long expected, long actual)
-
extractStringLiteral
protected static StringLiteral extractStringLiteral(Tree tree)
-
isMapping
protected static boolean isMapping(Expression expression)
-
-