Trim social follow action values#737
Conversation
Greptile SummaryThis PR fixes whitespace-padded
Confidence Score: 5/5Safe to merge — the change is a single The fix is minimal and targeted: one method added to an existing chain, covered by a new test. The error message still exposes the original user input, which is correct. The only gap is a missing symmetric test for No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CLI: --action value"] --> B{"unfollow flag set?"}
B -- yes --> C["return 'unfollow'"]
B -- no --> D["action ?? 'follow'"]
D --> E[".trim()"]
E --> F[".toLowerCase()"]
F --> G{"=== 'follow' or 'unfollow'?"}
G -- yes --> H["return normalized value"]
G -- no --> I["throw Error (shows original action)"]
Reviews (1): Last reviewed commit: "Trim social follow action values" | Re-trigger Greptile |
| expect(normalizeFollowAction(' unfollow ')).toBe('unfollow'); | ||
| expect(normalizeFollowAction('follow', true)).toBe('unfollow'); |
There was a problem hiding this comment.
The new assertion covers
' unfollow ' (trimmed 'unfollow'), but the symmetric case ' follow ' (trimmed 'follow') is not tested. Since the trim now applies to both values equally, a paired assertion would make the coverage symmetric and guard against future regressions on the follow side.
| expect(normalizeFollowAction(' unfollow ')).toBe('unfollow'); | |
| expect(normalizeFollowAction('follow', true)).toBe('unfollow'); | |
| expect(normalizeFollowAction(' unfollow ')).toBe('unfollow'); | |
| expect(normalizeFollowAction(' follow ')).toBe('follow'); | |
| expect(normalizeFollowAction('follow', true)).toBe('unfollow'); |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
CI is green for PR #737. Verification:
uGig invoice evidence has been sent for this PR. |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
5 similar comments
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Closes #736.
Summary
sh1pt promote social follow --actionvalues." unfollow ".Verification
corepack pnpm vitest run packages/cli/src/social-follow.test.tscorepack pnpm --filter @profullstack/sh1pt typecheck(fails on existing workspace/module-resolution errors unrelated to this change: missing@profullstack/sh1pt-core,@profullstack/sh1pt-openapi/*, etc.)