IJPL-90547 Suppress missing-space errors in chained references embedded into text

GitOrigin-RevId: 15b545318fb80b90fb7d3c9cae605ebc07729b0a
This commit is contained in:
Peter Gromov
2024-08-05 18:53:14 +02:00
committed by intellij-monorepo-bot
parent c6cd6187c9
commit 59e0ddc429
2 changed files with 5 additions and 6 deletions

View File

@@ -12,14 +12,12 @@ class PythonProblemFilter : ProblemFilter() {
if (domain == TextContent.TextDomain.LITERALS) {
return problem.fitsGroup(RuleGroup.LITERALS)
}
if (domain == TextContent.TextDomain.DOCUMENTATION && seemsDocString(problem.text) &&
(ProblemFilterUtil.isUndecoratedSingleSentenceIssue(problem) || ProblemFilterUtil.isInitialCasingIssue(problem))) {
if (domain == TextContent.TextDomain.DOCUMENTATION &&
(ProblemFilterUtil.isUndecoratedSingleSentenceIssue(problem) ||
ProblemFilterUtil.isInitialCasingIssue(problem) ||
problem.fitsGroup(RuleGroup(RuleGroup.UNDECORATED_SENTENCE_SEPARATION)))) {
return true
}
return false
}
private fun seemsDocString(text: TextContent) =
text.containingFile.viewProvider.contents.subSequence(0, text.textOffsetToFile(0)).trim().endsWith(":")
}

View File

@@ -6,6 +6,7 @@ class ExampleClassWithNoTypos:
"""A group of *members*.
This class has no useful logic; it's just a documentation example.
This class is useful for mocking requests.Response (the class that comes back from requests.get and friends).
Args:
name (str): the name of this group. And another sentence.