Skip to content

fix: 型安全性の改善 - Pythonフックの型アノテーション強化とJS8進数リテラル修正 - #829

Merged
keito4 merged 2 commits into
mainfrom
claude/issue-828-20260616-0302
Jun 16, 2026
Merged

fix: 型安全性の改善 - Pythonフックの型アノテーション強化とJS8進数リテラル修正#829
keito4 merged 2 commits into
mainfrom
claude/issue-828-20260616-0302

Conversation

@keito4

@keito4 keito4 commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Closes #828

変更内容

Python hooks - 型アノテーション強化

  • common.py: parse_tool_context tuple[str, dict, dict]
  • pre_git_quality_gates.py: 複数関数の戻り型改善
  • post_git_push_ci.py: run_id Noneチェック(バグ修正)と戻り型追加
  • post_pr_ci_watch.py, post_pr_ai_review.py: 戻り型追加

JavaScript

  • test/config-validation.test.js: parseInt を8進数リテラルに置換

Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved CI monitoring to detect missing workflow run IDs and exit early with a clear error, avoiding silent or misleading CI status output.
  • Refactor

    • Enhanced type annotations across CI/CD hook scripts for safer, more predictable public interfaces without changing runtime behavior.
  • Tests

    • Updated file-mode validation tests to use clearer numeric octal literals instead of parseInt(..., 8) for readability.

## Python hooks - 型アノテーション改善

- common.py: parse_tool_context の戻り型を tuple → tuple[str, dict, dict] に精密化
- pre_git_quality_gates.py:
  - detect_linter_conflicts: list → list[dict]
  - get_package_scripts: dict → dict[str, str]
  - run_with_retry: tuple → tuple[bool, dict]
  - last_result の型アノテーション追加 (dict | None)
- post_git_push_ci.py:
  - get_current_branch() → str | None の戻り型追加
  - get_latest_run() → dict | None の戻り型追加
  - watch_ci_run の run_id: int, timeout_seconds: int 型追加
  - watch_ci_run の戻り型 → tuple[str, list]
  - run_id が None の場合の早期リターン追加(実質バグ修正)
- post_pr_ci_watch.py: get_pr_checks → tuple[str, list] の戻り型追加
- post_pr_ai_review.py: post_pr_comment → bool の戻り型追加

## JavaScript - 型安全な書き方に改善

- test/config-validation.test.js: parseInt('111', 8) → 0o111 (明示的な8進数リテラル)
- test/config-validation.test.js: parseInt('004', 8) → 0o004

Closes #828

Co-authored-by: keito4 <keito4@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 898db2b8-f155-46bb-a517-82f63f8ed7bc

📥 Commits

Reviewing files that changed from the base of the PR and between cbe3804 and 26b71e0.

📒 Files selected for processing (2)
  • .claude/hooks/post_git_push_ci.py
  • .claude/hooks/pre_git_quality_gates.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • .claude/hooks/pre_git_quality_gates.py
  • .claude/hooks/post_git_push_ci.py

📝 Walkthrough

Walkthrough

Type annotations are added or tightened on public functions across five Python Claude hook scripts (common.py, post_git_push_ci.py, post_pr_ai_review.py, post_pr_ci_watch.py, pre_git_quality_gates.py). One behavioral change is included: post_git_push_ci.py gains a run_id is None guard that prints to stderr and exits early. The Jest test file replaces parseInt octal calls with numeric octal literals.

Changes

Type Safety Improvements (Issue #828)

Layer / File(s) Summary
Python hook type annotation updates
.claude/hooks/common.py, .claude/hooks/post_git_push_ci.py, .claude/hooks/post_pr_ai_review.py, .claude/hooks/post_pr_ci_watch.py, .claude/hooks/pre_git_quality_gates.py
Adds parameterized return types (tuple[str, dict, dict], Optional[str], Optional[dict], tuple[str, list], list[dict], dict[str, str], tuple[bool, dict]) to nine public functions, adds Optional typing imports, annotates the last_result local variable as Optional[dict], and refreshes the run_with_retry docstring. No runtime logic changes in any of these.
run_id None guard and test octal literals
.claude/hooks/post_git_push_ci.py, test/config-validation.test.js
Adds a defensive run_id is None check after get_latest_run() that prints an error to stderr and exits before CI watching proceeds. Replaces parseInt('111', 8) and parseInt('004', 8) with 0o111 and 0o004 octal literals in the Jest permission tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • keito4/config#555: Introduced the detect_linter_conflicts, get_package_scripts, and run_with_retry functions in pre_git_quality_gates.py whose signatures this PR now tightens.
  • keito4/config#385: Introduced the post_git_push_ci.py CI monitoring hook where this PR adds typed signatures and the run_id is None early-exit guard.
  • keito4/config#498: Refactored pre_git_quality_gates.py to use get_package_scripts and detect_linter_conflicts, the same functions whose return types are tightened here.

Suggested labels

size/M

🐇 Hop hop, the types are tight now,
tuple[str, dict, dict] shows the way!
A run_id guard stops a crash somehow,
And 0o111 keeps octal at bay.
No logic changed — just clarity found,
This bunny types safe on every round! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main changes: type safety improvements through Python hook type annotations and JavaScript octal literal fixes.
Description check ✅ Passed The description covers all required sections: it references the linked issue, details the changes made, and explains the fix in both Python and JavaScript.
Linked Issues check ✅ Passed The PR successfully addresses issue #828 by improving type safety through enhanced type annotations in Python hooks and fixing implicit type issues in JavaScript code.
Out of Scope Changes check ✅ Passed All changes are directly related to improving type safety as specified in issue #828; no unrelated modifications are present in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-828-20260616-0302

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 3m 50s —— View job


コードレビュー

  • 変更ファイルの読み込み
  • 差分の確認
  • レビューフィードバックの作成

総評

変更は全体的に質が高く、型安全性の向上とバグ修正を適切に実現しています。承認推奨 です。


ファイル別レビュー

.claude/hooks/common.py — 軽微な指摘

parse_tool_context の戻り型を tupletuple[str, dict, dict] に改善した点は明確で良いです。

ただし、common.py は引き続き Optional / Union をインポートしており(extract_pr_urlget_git_root で使用中)、PR 内では新スタイル (str | None) と旧スタイル (Optional[...]) が混在しています。今回の変更はスコープ外ですが、将来的に統一することを検討ください。


.claude/hooks/post_git_push_ci.py — バグ修正あり ✅

run_id is None チェックの追加は 実際のバグ修正 です。

以前は run_id = run.get("databaseId")None を返した場合、watch_ci_run 内で str(run_id)"None" という文字列になり、gh run view None が失敗するかサイレントに誤動作する可能性がありました。早期の sys.exit(0) で安全に終了するのが正しい対処です。

# ✅ 正しい修正
run_id = run.get("databaseId")
if run_id is None:
    print("⚠️  Run ID が取得できませんでした", file=sys.stderr, flush=True)
    sys.exit(0)

watch_ci_run(run_id: int, ...) の型も None チェック後なので int で妥当です。


.claude/hooks/pre_git_quality_gates.py — 推奨レベルの指摘

run_with_retry の戻り型 tuple[bool, dict] とローカル変数 last_result: dict | None の整合性:

return False, last_result or {"error": "Unknown error"}  # ✅ フォールバックで None を回避

None の場合は {"error": "Unknown error"} を返すため実際の型は正しいです。問題ありません。

list[dict]dict[str, str] の特殊化も適切です。


.claude/hooks/post_pr_ci_watch.py / post_pr_ai_review.py — 問題なし

戻り型追加のみで、ロジック変更なし。正確な型付けです。


test/config-validation.test.js — 改善 ✅

// Before: 紛らわしく、8進数であることが自明でない
expect(stats.mode & parseInt('111', 8)).toBeTruthy();

// After: 意図が明確
expect(stats.mode & 0o111).toBeTruthy();

8進数リテラルへの置換はより読みやすく、ESLint の no-octal ルールとも整合します。


軽微な推奨事項(ブロッカーではない)

箇所 指摘
post_pr_ci_watch.py:39 / post_git_push_ci.py:105 tuple[str, list] のリストが未特殊化。list[dict] にするとより正確
common.py Optional / Unionstr | None スタイルの混在(今回スコープ外)

Fix this →


結論

  • バグ修正(run_id is None チェック)は価値ある修正
  • 型アノテーションは実装と正確に対応している
  • JS の 8 進数リテラル化はコード品質向上
  • critical / major の問題なし → APPROVE

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbe3804740

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/hooks/post_git_push_ci.py Outdated


def get_current_branch():
def get_current_branch() -> str | None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep post-push hook annotations Python 3.9-compatible

In macOS/local setups where these hooks are invoked with the system python3 (the hook wiring calls plain python3 in .claude/settings.json), this PEP 604 annotation is evaluated when the function is defined and Python 3.9 raises TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'. That makes the post-push CI hook crash after a successful git push instead of reporting CI status; use Optional[str]/Optional[dict] or add from __future__ import annotations before using | here.

Useful? React with 👍 / 👎.

@keito4

keito4 commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

(aside)
@claude PRがbaseにマージする際にCIが落ちています。
修正してください。

@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 9m 33s —— View job


CI修正完了 ✅

  • CI失敗の原因を調査 → Python 3.9非互換の str | None / dict | None 構文 (PEP 604)
  • HEADからワーキングディレクトリを復元
  • post_git_push_ci.py を修正(Optional[str]/Optional[dict]に変換)
  • pre_git_quality_gates.py を修正(Optional[dict]に変換)
  • コミット・プッシュ

修正内容

原因: PEP 604の X | None 型構文はPython 3.10+のみサポート。Python 3.9環境でフックを実行すると TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' が発生。

修正ファイル:

ファイル 変更内容
.claude/hooks/post_git_push_ci.py from typing import Optional 追加、str | NoneOptional[str]dict | NoneOptional[dict]
.claude/hooks/pre_git_quality_gates.py from typing import Optional 追加、last_result: dict | NoneOptional[dict]

typing.Optional はPython 3.5+から利用可能。全521テスト通過を確認済み。

コミット: 26b71e0 fix: Python 3.9互換性 - str|None/dict|NoneをOptional[X]に変換
| Branch

@keito4 keito4 self-assigned this Jun 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/hooks/common.py:
- Around line 25-29: The project uses Python 3.10+ syntax throughout the hook
files (union types like str | None and lowercase generics like tuple[str, dict],
list[dict], dict[str, str]) but has no declared minimum Python version in its
configuration. This will silently break for users on Python 3.9 or earlier. Add
or update a project configuration file to explicitly require Python 3.10 or
later by adding requires-python = ">=3.10" to pyproject.toml (recommended), or
python_requires=">=3.10" to setup.py, or create .python-version with 3.10 or
later. The affected hook files at .claude/hooks/common.py (lines 25-29),
.claude/hooks/post_git_push_ci.py (lines 61-72, 75-102, 105-140),
.claude/hooks/post_pr_ai_review.py (lines 186-203),
.claude/hooks/post_pr_ci_watch.py (lines 41-100), and
.claude/hooks/pre_git_quality_gates.py (lines 74-115, 118-128, 156-220) do not
require direct code changes as they correctly use 3.10+ syntax; the
configuration-level fix will resolve the compatibility issue across all these
files.

In @.claude/hooks/post_git_push_ci.py:
- Line 61: The code uses Python 3.10+ union type syntax (str | None, dict |
None, tuple[str, list]) in multiple function signatures including
get_current_branch at line 61, but the repository lacks any Python version
constraint configuration. Create a new `.python-version` file in the repository
root and specify Python 3.10 as the minimum required version to ensure runtime
compatibility across all locations where this modern syntax is used.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 658bca23-6e0c-4c2b-a7aa-8d53e0524c1f

📥 Commits

Reviewing files that changed from the base of the PR and between 88f80e2 and cbe3804.

📒 Files selected for processing (6)
  • .claude/hooks/common.py
  • .claude/hooks/post_git_push_ci.py
  • .claude/hooks/post_pr_ai_review.py
  • .claude/hooks/post_pr_ci_watch.py
  • .claude/hooks/pre_git_quality_gates.py
  • test/config-validation.test.js

Comment thread .claude/hooks/common.py
Comment on lines +25 to +29
def parse_tool_context(data: dict) -> tuple[str, dict, dict]:
"""Extract standard tool context fields.

Returns:
tuple: (tool_name, tool_input, tool_response)
tuple[str, dict, dict]: (tool_name, tool_input, tool_response)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

What is the minimum Python version for the repository?

💡 Result:

The minimum Python version requirement for a repository is not universal and varies depending on the specific project. To determine the minimum Python version for a given repository, you should check the project's configuration files: 1. Look for a pyproject.toml file in the root directory and inspect the requires-python field [1][2][3][4]. 2. Check the setup.py file for a python_requires argument or a variable defining supported versions (e.g., SUPPORTED_PYTHON_VERSIONS) [5][6]. 3. Consult the README.md or CONTRIBUTING.md files, which often document environment requirements [1]. Many modern Python projects have standardized on Python 3.10 as a minimum version [7][1][2][3][4]. If you are looking for the requirement for a specific repository, please provide the name or URL of the repository so that the exact version can be verified.

Citations:


🏁 Script executed:

#!/bin/bash

# Check for pyproject.toml
if [ -f "pyproject.toml" ]; then
  echo "=== pyproject.toml ===" 
  cat pyproject.toml | head -50
fi

# Check for setup.py
if [ -f "setup.py" ]; then
  echo "=== setup.py ===" 
  head -50 setup.py
fi

# Check for .python-version
if [ -f ".python-version" ]; then
  echo "=== .python-version ==="
  cat .python-version
fi

# Check for setup.cfg
if [ -f "setup.cfg" ]; then
  echo "=== setup.cfg ==="
  head -30 setup.cfg
fi

# Look for any Python version specifications in CI files
if [ -d ".github/workflows" ]; then
  echo "=== GitHub Actions workflows ==="
  find .github/workflows -type f -name "*.yml" -o -name "*.yaml" | head -5 | xargs -I {} sh -c 'echo "File: {}"; cat "{}" | grep -i "python" -A 2 -B 2 | head -20'
fi

Repository: keito4/config

Length of output: 488


🏁 Script executed:

#!/bin/bash

# Read pyproject.toml if it exists and look for python requirement
echo "=== Checking pyproject.toml ===" 
if [ -f "pyproject.toml" ]; then
  cat pyproject.toml | head -100
else
  echo "pyproject.toml not found"
fi

echo ""
echo "=== Checking .python-version ===" 
if [ -f ".python-version" ]; then
  cat .python-version
else
  echo ".python-version not found"
fi

echo ""
echo "=== Checking CI workflow for Python version ===" 
if [ -f ".github/workflows/ci.yml" ]; then
  cat .github/workflows/ci.yml
fi

Repository: keito4/config

Length of output: 11647


🏁 Script executed:

#!/bin/bash

# Check if the hook files exist
echo "=== Checking for Python hook files ==="
ls -la .claude/hooks/*.py 2>/dev/null || echo "Hook files not found"

echo ""
echo "=== Checking for pre-commit configuration ==="
if [ -f ".pre-commit-config.yaml" ]; then
  cat .pre-commit-config.yaml
else
  echo ".pre-commit-config.yaml not found"
fi

echo ""
echo "=== Checking README for Python version info ==="
if [ -f "README.md" ]; then
  grep -i "python" README.md | head -20
else
  echo "README.md not found"
fi

echo ""
echo "=== Listing all config files ==="
find . -maxdepth 2 -type f \( -name "*.toml" -o -name "*.cfg" -o -name "*.ini" -o -name ".python*" \) 2>/dev/null

Repository: keito4/config

Length of output: 1438


🏁 Script executed:

#!/bin/bash

echo "=== Checking ruff.toml for Python version ==="
if [ -f "ruff.toml" ]; then
  cat ruff.toml
else
  echo "ruff.toml not found"
fi

echo ""
echo "=== Checking .codex/config.toml ==="
if [ -f ".codex/config.toml" ]; then
  cat .codex/config.toml
else
  echo ".codex/config.toml not found"
fi

echo ""
echo "=== Checking .gitleaks.toml ==="
if [ -f ".gitleaks.toml" ]; then
  head -50 .gitleaks.toml
fi

echo ""
echo "=== Checking for any Python version reference in codebase ==="
rg "requires-python|python_requires|3\.9|3\.10|3\.11" --type toml --type py . 2>/dev/null | head -20

Repository: keito4/config

Length of output: 3727


🏁 Script executed:

#!/bin/bash

# Check the actual hook files for Python version requirements
echo "=== Checking common.py for union syntax ==="
head -35 .claude/hooks/common.py

echo ""
echo "=== Checking post_git_push_ci.py for union syntax ==="
head -80 .claude/hooks/post_git_push_ci.py | tail -25

echo ""
echo "=== Checking for shebang lines in hook files ==="
head -1 .claude/hooks/common.py
head -1 .claude/hooks/post_git_push_ci.py
head -1 .claude/hooks/pre_git_quality_gates.py

echo ""
echo "=== Searching for any Python version specification in hook files ==="
rg "python" .claude/hooks/ | grep -i "version\|3\.[0-9]" || echo "No version specs found in hooks"

Repository: keito4/config

Length of output: 1890


🏁 Script executed:

#!/bin/bash

echo "=== common.py type annotations ==="
grep -n "def\|->.*:" .claude/hooks/common.py | head -20

echo ""
echo "=== post_git_push_ci.py type annotations ==="
grep -n "def.*->.*:" .claude/hooks/post_git_push_ci.py | head -15

echo ""
echo "=== post_pr_ai_review.py type annotations ==="
grep -n "def.*->.*:" .claude/hooks/post_pr_ai_review.py | head -15

echo ""
echo "=== post_pr_ci_watch.py type annotations ==="
grep -n "def.*->.*:" .claude/hooks/post_pr_ci_watch.py | head -15

echo ""
echo "=== pre_git_quality_gates.py type annotations ==="
grep -n "def.*->.*:" .claude/hooks/pre_git_quality_gates.py | head -15

Repository: keito4/config

Length of output: 1574


🏁 Script executed:

#!/bin/bash

echo "=== Checking common.py for union syntax usage ==="
rg "\|" .claude/hooks/common.py | head -10

echo ""
echo "=== Checking post_git_push_ci.py for union syntax usage ==="
rg "\|" .claude/hooks/post_git_push_ci.py | head -10

echo ""
echo "=== Checking pre_git_quality_gates.py for union syntax usage ==="
rg "\|" .claude/hooks/pre_git_quality_gates.py | head -10

echo ""
echo "=== Checking all hook files for lowercase generic syntax ==="
rg "list\[|dict\[|tuple\[" .claude/hooks/*.py | head -20

echo ""
echo "=== Summary: Python version requirements needed ==="
echo "Files using 3.10+ syntax:"
echo "- common.py: tuple[str, dict, dict] at line 25"
echo "- post_git_push_ci.py: str | None (lines 61, 75), tuple[str, list] (line 105)"
echo "- post_pr_ci_watch.py: tuple[str, list] (line 41)"
echo "- pre_git_quality_gates.py: list[dict] (line 74), dict[str, str] (line 118)"

Repository: keito4/config

Length of output: 1658


Add Python 3.10+ minimum version requirement to project configuration.

The hook files use Python 3.10+ syntax (union types X | None and lowercase generic types like list[dict], dict[str, str], tuple[str, list]) but the project has no declared Python version requirement. This will silently break for users on Python 3.9 or earlier. Create or update a configuration file with an explicit minimum:

  • Add requires-python = ">=3.10" to pyproject.toml (recommended)
  • OR add python_requires=">=3.10" to setup.py
  • OR create .python-version with 3.10 or later

Affected files using 3.10+ syntax:

  • .claude/hooks/common.py: tuple[str, dict, dict]
  • .claude/hooks/post_git_push_ci.py: str | None, dict | None, tuple[str, list]
  • .claude/hooks/post_pr_ci_watch.py: tuple[str, list]
  • .claude/hooks/pre_git_quality_gates.py: list[dict], dict[str, str], dict | None, tuple[bool, dict]
  • .claude/hooks/post_edit_auto_lint.py: list[str]
📍 Affects 5 files
  • .claude/hooks/common.py#L25-L29 (this comment)
  • .claude/hooks/post_git_push_ci.py#L61-L72
  • .claude/hooks/post_git_push_ci.py#L75-L102
  • .claude/hooks/post_git_push_ci.py#L105-L140
  • .claude/hooks/post_pr_ai_review.py#L186-L203
  • .claude/hooks/post_pr_ci_watch.py#L41-L100
  • .claude/hooks/pre_git_quality_gates.py#L74-L115
  • .claude/hooks/pre_git_quality_gates.py#L118-L128
  • .claude/hooks/pre_git_quality_gates.py#L156-L220
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/hooks/common.py around lines 25 - 29, The project uses Python 3.10+
syntax throughout the hook files (union types like str | None and lowercase
generics like tuple[str, dict], list[dict], dict[str, str]) but has no declared
minimum Python version in its configuration. This will silently break for users
on Python 3.9 or earlier. Add or update a project configuration file to
explicitly require Python 3.10 or later by adding requires-python = ">=3.10" to
pyproject.toml (recommended), or python_requires=">=3.10" to setup.py, or create
.python-version with 3.10 or later. The affected hook files at
.claude/hooks/common.py (lines 25-29), .claude/hooks/post_git_push_ci.py (lines
61-72, 75-102, 105-140), .claude/hooks/post_pr_ai_review.py (lines 186-203),
.claude/hooks/post_pr_ci_watch.py (lines 41-100), and
.claude/hooks/pre_git_quality_gates.py (lines 74-115, 118-128, 156-220) do not
require direct code changes as they correctly use 3.10+ syntax; the
configuration-level fix will resolve the compatibility issue across all these
files.

Comment thread .claude/hooks/post_git_push_ci.py Outdated
PEP 604のユニオン型構文(X | None)はPython 3.10+のみサポート。
Python 3.9環境でフックが実行時エラーになる問題を修正。
typing.OptionalはPython 3.5+で利用可能。

Fixes: Codexレビュー指摘 (post_git_push_ci.py:61)

Co-authored-by: keito4 <keito4@users.noreply.github.com>
@keito4
keito4 merged commit b04d2ab into main Jun 16, 2026
2 checks passed
@keito4
keito4 deleted the claude/issue-828-20260616-0302 branch June 16, 2026 07:01
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.116.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

型安全性の改善

1 participant