Commit graph

260 commits

Author SHA1 Message Date
Otto Kekäläinen
b19e682455
Update test to be compatible with latest Glamour v0.8.0
Latest Glamour has slightly changed logic in line length / wrapping,
resulting test failures due to string mismatch. Update tests and bump
dependency to v0.8.0, and others to the bare minimal level as generated
by `go mod tidy`.

This was detected then building the GitHub cli package `gh` in Debian
started to fail with src:golang-github-charmbracelet-glamour 0.8.0-1.

Closes: #10179
2025-01-22 20:13:40 -08:00
Kynan Ware
facd0caa29 Fix: accidental whitespace in gist edit 2025-01-16 11:44:46 -07:00
Kynan Ware
5b6fd53a88 Fix: gist edit test name 2025-01-16 11:36:48 -07:00
Kynan Ware
dec46670bb Fix: gist edit/view tests var name consistency 2025-01-16 11:14:33 -07:00
Kynan Ware
a2dce589d6 Merge 'trunk' into fix/issue_10042 2025-01-16 11:06:36 -07:00
Kynan Ware
35d81e3ff5 Fix: Gist edit tests for interactivity
This changes the gist edit tests to use the positive `istty` instead of the previous inverse `nontty`, which is consistent with the way other commands are written.
2025-01-16 10:46:07 -07:00
Tyler McGoffin
3feeb9a826 Add tests for deleteGist 2025-01-14 14:21:49 -08:00
Mateus Marquezini
c0f6eb0598 #10042: Attempt to add a new test scenario for handling error messages when TTY is unavailable 2025-01-13 11:39:48 -03:00
Mateus Marquezini
977e2326a2 #10042: Applied code review suggestions to view_test.go 2025-01-13 11:06:13 -03:00
danochoa
1d9b4e4464 fix tests 2025-01-12 19:36:44 -06:00
danochoa
08f7706c42 fix tests 2025-01-12 19:18:24 -06:00
danochoa
7885167c70 gist delete - check no gists 2025-01-12 17:01:45 -06:00
Mateus Marquezini
24e9fed7e0 removed unnecessary space 2025-01-12 14:57:24 -03:00
Mateus Marquezini
c5d6ae6cf6
Update pkg/cmd/gist/edit/edit.go
Update pkg/cmd/gist/edit/edit.go after code review

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-01-12 14:53:20 -03:00
danochoa
5de282c970 drop description from prompts, fix tests 2025-01-11 01:35:12 -06:00
danochoa
7f71681ace gist delete - use in confirmation and success info 2025-01-10 01:07:11 -06:00
Mateus Marquezini
4c2ba5681d #10042 removed unnecessary field 2025-01-09 13:14:27 -03:00
Mateus Marquezini
f4f8840c3f #10042: Add error messages for 'gh gist view/edit' prompts when no TTY is detected 2025-01-09 12:07:15 -03:00
danochoa
dccbc99fdf fix gist description in tests 2025-01-08 20:47:50 -06:00
danochoa
9c65a32ef8 gist delete prompt with gist description 2025-01-08 17:56:02 -06:00
danochoa
a8f0aaeb3d tentative updates for acceptance criteria
- pending confirmation re description in prompt
2025-01-08 02:22:21 -06:00
danochoa
75ace410a3 cleanup 2025-01-03 13:09:32 -06:00
danochoa
f87d9f98f1 gist delete prompt for confirmation 2025-01-03 12:51:09 -06:00
danochoa
61ffbe157d undo extra move 2024-12-31 01:43:39 -06:00
danochoa
8390b4154b rearrange struct vals for consistency 2024-12-30 18:18:50 -06:00
danochoa
8f19d3b102 add gist delete tests for blank gist id 2024-12-30 17:24:10 -06:00
danochoa
049332d844 gh gist delete: prompt for gist id 2024-12-30 15:41:18 -06:00
Mateus Marquezini
b740486b13 #10042 fixed test 2024-12-09 10:59:09 -03:00
Mateus Marquezini
cbaaf77822 fixing gh gist view prompts with no TTY 2024-12-09 08:35:01 -03:00
Tyler McGoffin
7aef6ec391
Merge pull request #9728 from heaths/issue9704
Supporting filtering on `gist list`
2024-10-15 16:26:13 -07:00
Heath Stewart
446f66070a
Add filtered content output to docs 2024-10-15 14:39:21 -07:00
Tyler McGoffin
ddf90c78c2 Remove IsTenancy and relevant tests from gists as they are unsupported 2024-10-15 12:41:23 -07:00
Tyler McGoffin
e1a39d8e2b Add ghe.com to tests describing ghec data residency 2024-10-15 12:24:41 -07:00
Tyler McGoffin
81591a09b8 Use go-gh/auth package for IsEnterprise, IsTenancy, and NormalizeHostname 2024-10-15 11:56:43 -07:00
Tyler McGoffin
3a8417f6c7 Add test coverage to places where IsEnterprise incorrectly covers Tenancy
IsEnterprise currently returns `true` when `IsTenancy` returns true. We
prefer that this behavior is orthogonal. This commit adds failing tests to
the instances where IsEnterprise should not behave the same as IsTenancy.

These test cases are expected to pass with the inclusion of the coming
improvements to go-gh to handle the orthogonality of IsEnterprise and
IsTenancy.
2024-10-15 11:56:43 -07:00
Heath Stewart
9e00f1e4f2
Resolve PR feedback 2024-10-14 15:08:23 -07:00
Heath Stewart
e9d8092ffc
Don't append remaining text if more matches 2024-10-12 23:17:57 -07:00
Heath Stewart
bddadef574
Highlight matches in table and content
When `--filter` is passed, matches will be highlighted in the existing table. If file names match, the "n file(s)" cell will be highlighted.

When `--include-content` is additionally passed, the file name, description, and/or content will be printed like `search code` with matches highlighted.
2024-10-12 23:17:56 -07:00
Heath Stewart
86f045ef0e
Split all newlines, and output no-color to non-TTY 2024-10-12 23:17:56 -07:00
Heath Stewart
70b14215ec
Print filtered gists similar to code search 2024-10-12 23:17:56 -07:00
Heath Stewart
4eaeda580b
Show progress when filtering
Filtering can take a while, so show progress. This also uncovered a bug
that I wasn't checking if a filter was actually specified, resulting in
a non-nil `opts.Filter`.
2024-10-12 23:17:56 -07:00
Heath Stewart
1615f2c1e1
Simplify description 2024-10-12 23:17:56 -07:00
Tyler McGoffin
b56353dc02
Disallow use of --include-content without --filter 2024-10-12 23:17:55 -07:00
Heath Stewart
73af9f8bd9
Improve help docs
Also changes `--filter` argument to "expression" to coincide with some other commands' help text e.g., `--jq`.
2024-10-12 23:17:55 -07:00
Heath Stewart
34203d7e6c
Refactor filtering into existing gist list
Resolves feedback in issue #9704
2024-10-12 23:17:55 -07:00
Heath Stewart
2fb5687777
Improve performance
Filter as we get results instead of getting them all. This allows us to more easily terminate pagination when opts.Limit is reached.
2024-10-12 23:17:55 -07:00
Heath Stewart
8c6d4c9c52
Add gist search command
Resolves #9704
2024-10-12 23:17:52 -07:00
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
William Martin
07e0ff7127 Fix repo fork to use remote protocol if none configured 2024-05-10 10:48:36 +02:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00