Skip to content

Commit

Permalink
Fix test: don't complain about unused type var.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Feb 7, 2025
1 parent 675597e commit fc39209
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ public void addUnusedMessage(SimpleNode node, Found f) {
if (startsWithNamesToIgnore(g)) {
int type = IAnalysisPreferences.TYPE_UNUSED_VARIABLE;

boolean addMessage = true;
if (g.tok instanceof SourceToken) {
SourceToken t = (SourceToken) g.tok;
SimpleNode ast = t.getAst();
Expand All @@ -325,14 +326,16 @@ public void addUnusedMessage(SimpleNode node, Found f) {
if (n.ctx == NameTok.KwArg || n.ctx == NameTok.VarArg || n.ctx == NameTok.KeywordName) {
type = IAnalysisPreferences.TYPE_UNUSED_PARAMETER;
}
if (n.ctx == NameTok.TypeVarName) {
continue;
}
} else if (ast instanceof Name) {
Name n = (Name) ast;
if (n.ctx == Name.Param || n.ctx == Name.KwOnlyParam) {
type = IAnalysisPreferences.TYPE_UNUSED_PARAMETER;
}
}
}
boolean addMessage = true;
if (type == IAnalysisPreferences.TYPE_UNUSED_PARAMETER) {
// just add unused parameters in methods that have some content (not only 'pass' and 'strings')

Expand Down

0 comments on commit fc39209

Please sign in to comment.