Commit graph

64 commits

Author SHA1 Message Date
Lucas
26f1d48fa4
test(gist): add tests for handling truncated files in view command
* Added test cases for viewing truncated files with and without the raw flag.
* Included scenarios for multiple files with truncation behavior.
* Ensured correct output is returned for truncated files when accessed via raw URLs.
2025-09-20 06:55:38 +02:00
Lucas
704bb4164c
feat(gist): retrieve full content for truncated gist files
* Added logic to fetch the full content of a gist file if it is marked as truncated.
* Utilizes the `GetRawGistFile` function to obtain the complete content from the provided `RawURL`.
2025-09-18 06:35:31 +02:00
Andy Feller
918cafc222 Deprecate ColorScheme.Gray for ColorScheme.Muted
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.

There is a little extra tidying up with local variable names or converting code to use Mutedf format.
2025-04-06 10:18:48 -04:00
Kynan Ware
c1fbc2f05b test(many): fix whitespace in tests expectations
Due to https://github.com/charmbracelet/glamour/pull/334, the margin
used for markdown rendering has changed by a couple spaces. This
corrects the relevant tests to accomodate that change.
2025-03-27 14:21:13 -06:00
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
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
Mateus Marquezini
977e2326a2 #10042: Applied code review suggestions to view_test.go 2025-01-13 11:06:13 -03: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
9c65a32ef8 gist delete prompt with gist description 2025-01-08 17:56:02 -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
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
Kousik Mitra
31209bcf89
Replace SurveyAskOne with Prompter 2023-06-05 22:48:21 +05:30
Kousik Mitra
9ccd098eb0
Add gist selector option to gist edit command 2023-06-05 22:07:04 +05:30
Sam Coe
c9a2d85793
Cleanup config.AuthToken and config.DefaultHost methods (#7049) 2023-02-28 00:24:45 +00:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Mark Woods
e876b22963
Change markdown wrap limit match terminal width (#6016) 2022-09-01 07:36:25 +00:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
vilmibm
d5334f4115 Revert "update linter checks"
This reverts commit 40ecb8c188.
2022-07-27 13:30:41 -05:00
vilmibm
40ecb8c188 update linter checks 2022-07-26 16:06:52 -05:00
Sam Coe
cacff4ad6d
Use go-gh config package (#5771) 2022-06-23 11:50:04 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mislav Marohnić
a33b5a55c4 Have NewAskStubber perform auto-cleanup 2022-01-14 18:52:00 +01:00
Mislav Marohnić
30c5ef23ee Merge remote-tracking branch 'origin' into ask-stubber 2022-01-14 17:41:08 +01:00
Mislav Marohnić
456d55ead9 Have a single Render function handle all Markdown rendering 2022-01-13 19:39:43 +01:00
Mislav Marohnić
c839d3ba1d Check for unused ask stubs at the end of the test 2022-01-13 12:23:42 +01:00
rsteube
24c41b5e88 gist view: fix missing files shorthand
converted to `BoolVar`
2021-12-03 10:45:33 +01:00
Mislav Marohnić
2c86e671f3 Enable gh auth login for github.localhost 2021-10-18 20:01:18 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Heath Stewart
88af63d36f
Re-enable label colors for issue list (#4106)
* Re-enable label colors for issue list
* Drop parentheses wrapping issue labels
* Support ANSI escape codes in TablePrinter cells
* Switch to a Truncate implementation that correctly measures ANSI escape codes
* Only output RGB color if terminal has truecolor capabilities
* Enable `ENABLE_VIRTUAL_TERMINAL_PROCESSING` on Windows - fixes wrapping issues with full lines and allows truecolor rendering

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 19:55:12 +02:00
Mislav Marohnić
44ae7ae3cf
Merge pull request #3279 from cli/browser-refactor
Pass web browser to each individual command
2021-03-30 16:54:59 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
2021-03-19 21:22:37 +01:00
Nate Smith
2ab073d599
Refactor use of glamour to allow style overrides (#3243)
* Refactor use of glamour to allow style overrides

* leave the things the way they were and just expose the ability to set overrides
2021-03-19 16:29:32 +00:00
Mislav Marohnić
066ba54549 Sort gist files case-insensitively 2021-03-02 14:53:19 +01:00
Mislav Marohnić
77d9051d0e Simplify looking up binary types in gist 2021-03-02 14:53:10 +01:00
Gowtham Munukutla
973fbb0925 Disallow operating on binary files in gist 2021-03-02 14:52:44 +01:00
vilmibm
39718cd5ca just hide empty descriptions 2021-03-01 16:07:04 -06:00
vilmibm
e100b15acb some text tweaks 2021-03-01 16:03:48 -06:00
boonhong
5403a37601 Add interactive select in gist view 2021-02-24 18:38:05 +08:00
Mislav Marohnić
622317ee89 Tweak gist docs 2021-02-03 22:39:58 +01:00
Ruslan Gilyazetdinov
907524f459 add --files to list filenames in gist (#2885) 2021-02-03 22:39:58 +01:00
Mislav Marohnić
3f7b1387e5 Improve gist view rendering
- Separate out logic to render a single file
- Render directly to stdout instead of to string slice
- Normalize whitespace between files; ensure no excessive trailing whitespace
- Add terminal pager support
- Sentence-case for flags
2021-02-02 14:21:48 +01:00
Ruslan Gilyazetdinov
bf4370bc3a linter fixes 2021-02-02 10:56:29 +03:00
Ruslan Gilyazetdinov
232dc7b7fa change condition for single file, remove empty lines in single file mode 2021-02-02 10:54:07 +03:00
Ruslan Gilyazetdinov
8e86129e2e remove gist description from single file raw view (#2886) 2021-02-01 18:49:26 +03:00
Cristian Dominguez
55c717d3d3 Print friendly error when 'gh gist <command>' is missing required argument 2020-12-21 10:01:30 -03:00
Cristian Dominguez
fa8674386b
Render links as absolute URLs in repo view (#2363)
Co-authored-by: Cristian Dominguez <cristiand391@users.noreply.github.com>
2020-11-11 13:13:19 +01:00