Skip to content

Commit 7226bd2

Browse files
committed
fix: address code quality issues
- Remove unused variable 'after_colon' - Extract common_words list to avoid long line - Improve code readability
1 parent 3fa0662 commit 7226bd2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lazydocs/generation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,19 +589,18 @@ def _lines_isvalid(lines: list, start_index: int, blockindent: int,
589589
# Check if the part before the colon contains URL indicators or
590590
# is likely descriptive text rather than an argument name
591591
before_colon = match.group(1) if match else ""
592-
after_colon = match.group(2) if match else ""
593592

594593
# Heuristics to detect non-argument lines:
595594
# 1. The text before colon contains "http" (part of a URL)
596595
# 2. The line contains "://" (URL protocol)
597596
# 3. The text before colon is too long to be an argument name (>40 chars)
598597
# 4. The text before colon contains common English words that aren't argument names
598+
common_words = ["see", "to find", "refer", "documentation", "available"]
599599
is_not_argument = (
600600
"http" in before_colon.lower() or
601601
"://" in line or
602602
len(before_colon) > 40 or
603-
# Check for common descriptive phrases (without trailing space)
604-
any(word in before_colon.lower() for word in ["see", "to find", "refer", "documentation", "available"])
603+
any(word in before_colon.lower() for word in common_words)
605604
)
606605

607606
if match and is_not_argument:

0 commit comments

Comments
 (0)