šŸ› fix: doctor's hook check leaves out comments and docstrings

Merged
AT
1mo ago
+62-2

Slice: #116

doctor warned that two of a client's hooks reach GitHub outside
as-agent when neither does: one names gh in a comment, the other
quotes git push --force in a docstring of the Python it runs from a
heredoc. The check now leaves out # comments (at a line's start or
after a space) and triple-quoted docstrings before matching.

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes the doctor's hook check so hooks that mention gh or git push only in comments or docstrings are no longer flagged as reaching GitHub outside as-agent. The check strips # comments and triple-quoted docstrings before matching.

  • A # only starts a comment outside quotes, after a space or one of ;&|(), so quoted text still counts as a call.
  • A triple-quoted string is only treated as a docstring when it starts a line, so one passed to code still counts.