Skip to content

Commit 5e54350

Browse files
k-ibarakiclaude
andcommitted
docs: Fix docstring accuracy and improve code documentation
Self-review findings and fixes: 1. Fix validate_frozen_rows docstring accuracy - Corrected is_valid description: only False when exceeds limit - Clarified validated_frozen_rows behavior for negative values - Implementation and documentation now match 2. Improve expand_axis_range documentation - Add concrete examples first for better understanding - Add Args and Returns sections - Replace abstract description with clear examples Quality metrics maintained: - All 220 tests pass - Coverage: 81-100% (helper classes) - Type check, lint, format: all pass Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ea5ceeb commit 5e54350

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/excel/pane_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def validate_frozen_rows(frozen_rows: int, max_limit: int) -> tuple[bool, int]:
6767
6868
Returns:
6969
(is_valid, validated_frozen_rows)のタプル
70-
- is_valid: 上限以内ならTrue、超過または負の場合はFalse
71-
- validated_frozen_rows: 無効時は0、それ以外は元の値
70+
- is_valid: 上限超過の場合のみFalse、それ以外はTrue
71+
- validated_frozen_rows: 負の値は0に丸める、上限超過は0、それ以外は元の値
7272
"""
7373
# 負の値は無効として0に丸める
7474
if frozen_rows < 0:

src/excel/range_calculator.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,19 @@ def merge_ranges(range1: str, range2: str) -> str:
117117
@staticmethod
118118
def expand_axis_range(range_str: str) -> str:
119119
"""
120-
指定されたセル範囲を「枠分離」ではなく「方向に拡張」する。
121-
- 単一セル (例: C5) -> C1:C5
122-
- 単一列 (例: Z100:Z200) -> Z1:Z200
123-
- 単一行 (例: D200:Z200) -> A200:Z200
124-
- それ以外(矩形など)はそのまま
120+
単一セル・列・行を1行目/A列まで拡張する
121+
122+
Examples:
123+
- 単一セル: "C5" -> "C1:C5"(列方向に拡張)
124+
- 単一列: "Z100:Z200" -> "Z1:Z200"(上端まで拡張)
125+
- 単一行: "D200:Z200" -> "A200:Z200"(左端まで拡張)
126+
- 矩形範囲: そのまま(変更なし)
127+
128+
Args:
129+
range_str: セル範囲文字列
130+
131+
Returns:
132+
拡張されたセル範囲(または元の範囲)
125133
"""
126134
if not range_str:
127135
return range_str

0 commit comments

Comments
 (0)