housebroken-cli 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/PKG-INFO +1 -1
  2. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/pyproject.toml +1 -1
  3. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/inbox.sh +27 -20
  4. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/.gitignore +0 -0
  5. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/LICENSE +0 -0
  6. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/README.md +0 -0
  7. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/bin/housebroken +0 -0
  8. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/hatch_build.py +0 -0
  9. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/check-ai-policy.sh +0 -0
  10. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/comment-census.sh +0 -0
  11. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/diff-defaults.sh +0 -0
  12. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/distinct-outside.sh +0 -0
  13. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/file-pr.sh +0 -0
  14. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/fork-hygiene.sh +0 -0
  15. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/notes.sh +0 -0
  16. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/pr-sweep.sh +0 -0
  17. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/prior-art.sh +0 -0
  18. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/scripts/verify-filed-pr.sh +0 -0
  19. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/skills/housebroken/SKILL.md +0 -0
  20. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/src/housebroken/__init__.py +0 -0
  21. {housebroken_cli-0.2.3 → housebroken_cli-0.2.4}/src/housebroken/cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: housebroken-cli
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Agent-written pull requests that do not make a mess in someone else's house.
5
5
  Project-URL: Repository, https://github.com/lenamonj/housebroken
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "housebroken-cli"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "Agent-written pull requests that do not make a mess in someone else's house."
9
9
  dynamic = ["readme"]
10
10
  license = "MIT"
@@ -64,7 +64,7 @@ if [ -z "$since" ]; then
64
64
  if [ -s "$cursor_file" ]; then since="$(head -1 "$cursor_file")"; else since="$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -v-24H +%Y-%m-%dT%H:%M:%SZ)"; fi
65
65
  fi
66
66
 
67
- is_bot() { case "$1" in *"[bot]"|copilot-pull-request-reviewer|codecov-commenter|coveralls|CLAassistant|meta-cla*|vercel*|coderabbitai*|copy-pr-bot*|oracle-contributor-agreement*|dependabot*|github-actions*|sonarcloud*|netlify*) return 0 ;; *) return 1 ;; esac; }
67
+ is_bot() { case "$1" in *"[bot]"|Copilot|copilot*|codecov-commenter|coveralls|CLAassistant|meta-cla*|vercel*|coderabbitai*|copy-pr-bot*|oracle-contributor-agreement*|dependabot*|github-actions*|sonarcloud*|netlify*) return 0 ;; *) return 1 ;; esac; }
68
68
 
69
69
  echo "== inbox for $user since $since (now $now) =="
70
70
  if ! feed="$(gh api "notifications?all=true&since=$since&per_page=100" --paginate 2>/dev/null)"; then
@@ -85,27 +85,34 @@ while IFS= read -r t; do
85
85
  echo
86
86
  echo "--- $repo#$num [$reason, $at] $state"
87
87
  echo " $title"
88
- if [ -n "$latest" ]; then
89
- if c="$(gh api "$latest" 2>/dev/null)"; then
90
- who=$(jq -r '.user.login // "?"' <<<"$c"); when=$(jq -r '.created_at // .submitted_at // ""' <<<"$c"); where=$(jq -r 'if .path then " on " + .path + ":" + ((.line // .original_line // 0)|tostring) else "" end' <<<"$c"); rstate=$(jq -r '.state // ""' <<<"$c")
91
- if [ "$who" = "$user" ]; then
92
- echo " latest: yours, $when"
93
- elif is_bot "$who"; then
94
- echo " latest: $who (bot), $when$where"
95
- else
96
- human=$((human + 1))
97
- echo " latest: $who, $when$where${rstate:+ [$rstate]}"
98
- jq -r '.body // ""' <<<"$c" | sed 's/^/ | /'
99
- fi
100
- else
101
- echo " latest comment could not be fetched: $latest"
102
- fi
88
+ ic="$(gh api "repos/$repo/issues/$num/comments?since=$since&per_page=100" 2>/dev/null || echo '[]')"
89
+ if [ "$type" = "PullRequest" ]; then
90
+ rc="$(gh api "repos/$repo/pulls/$num/comments?since=$since&per_page=100" 2>/dev/null || echo '[]')"
91
+ rv="$(gh api "repos/$repo/pulls/$num/reviews?per_page=100" 2>/dev/null || echo '[]')"
103
92
  else
104
- echo " (no comment attached: a review, a merge, a close, a mention or a review request; see the state above)"
105
- if [ "$type" = "PullRequest" ]; then
106
- gh api "repos/$repo/pulls/$num/reviews?per_page=100" --jq --arg since "$since" --arg me "$user" '.[] | select(.submitted_at > $since and .user.login != $me) | " review " + .state + " by " + .user.login + ", " + .submitted_at + (if (.body // "") != "" then "\n | " + (.body | gsub("\r\n"; "\n | ")) else "" end)' 2>/dev/null
107
- fi
93
+ rc='[]'; rv='[]'
108
94
  fi
95
+ events="$(jq -nc --argjson ic "$ic" --argjson rc "$rc" --argjson rv "$rv" --arg since "$since" '
96
+ [ ($ic[] | {t: .created_at, who: (.user.login // "?"), kind: "comment", where: "", rst: "", body: (.body // "")}),
97
+ ($rc[] | {t: .created_at, who: (.user.login // "?"), kind: "inline", where: (" on " + .path + ":" + ((.line // .original_line // 0) | tostring)), rst: "", body: (.body // "")}),
98
+ ($rv[] | select((.submitted_at // "") > $since) | {t: .submitted_at, who: (.user.login // "?"), kind: "review", where: "", rst: (.state // ""), body: (.body // "")}) ]
99
+ | sort_by(.t) | .[]' 2>/dev/null)"
100
+ shown=0
101
+ while IFS= read -r e; do
102
+ [ -n "$e" ] || continue
103
+ who=$(jq -r .who <<<"$e"); when=$(jq -r .t <<<"$e"); kind=$(jq -r .kind <<<"$e"); where=$(jq -r .where <<<"$e"); rst=$(jq -r .rst <<<"$e")
104
+ shown=$((shown + 1))
105
+ if [ "$who" = "$user" ]; then
106
+ echo " $when yours: $kind$where"
107
+ elif is_bot "$who"; then
108
+ echo " $when $who (bot): $kind$where${rst:+ [$rst]}"
109
+ else
110
+ human=$((human + 1))
111
+ echo " $when $who: $kind$where${rst:+ [$rst]}"
112
+ jq -r .body <<<"$e" | tr -d '\r' | sed 's/^/ | /'
113
+ fi
114
+ done <<<"$events"
115
+ [ "$shown" -gt 0 ] || echo " (no comment or review since the cursor: a merge, a close, a push, a mention or a review request; see the state above)"
109
116
  done <<<"$threads"
110
117
 
111
118
  if [ "$do_ci" -eq 1 ]; then
File without changes