Commit Graph

90 Commits

Author SHA1 Message Date
Evan Read 92d2982ad1 chore: update Vale and Markdownlint versions and configuration 2023-11-20 16:15:41 +10:00
Gary Holtz 7932b105ba
fix: Preventing a panic when not using a sub command 2023-06-28 11:41:23 -05:00
Jay McCure b834f40e4c
fix(check-update): always show error when check-update fails 2023-06-09 18:34:38 +10:00
Sebastian Krebs 8057b90615 fix: remove executable flag from non-executables 2023-04-27 01:56:44 +00:00
Gary Holtz 45ac8caaff fix: Change platform generating code 2023-04-12 22:39:49 +00:00
Vitali Tatarintev 0534f1b02d feat(docs): Add aliases to gen-docs 2023-04-04 01:33:12 +00:00
Jay McCure a6d9808b86 Merge branch 'add-debug-variable-makefile' into 'main'
chore: add debug environment variable to Makefile

See merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1197

Merged-by: Jay McCure <jmccure@gitlab.com>
Approved-by: Jay McCure <jmccure@gitlab.com>
Approved-by: James Liu <jliu@gitlab.com>
Reviewed-by: Jay McCure <jmccure@gitlab.com>
Co-authored-by: Jaime Martinez <jmartinez@gitlab.com>
2023-03-09 05:20:34 +00:00
Jaime Martinez 5afb7aae66 chore: add debug environment variable to Makefile 2023-03-09 05:20:33 +00:00
Gary Holtz a72ecfeda6 chore: remove build date and add architecture 2023-03-09 02:31:35 +00:00
Gary Holtz d71d6fff30 chore: Modify UserAgent to be more like other CLIs 2023-03-08 16:36:03 +00:00
Patrick Bajao 43a6a99832 chore: Expose make gen-docs task 2023-02-07 08:22:45 +00:00
Kai Armstrong 39e9e21313 chore: re-add linting/formatting job to ci 2022-11-17 18:36:09 +00:00
James Liu 5e00cdf125 fix: Read hostname from config.yml 2022-11-07 20:52:56 +00:00
Kai Armstrong 767fd66c31 fix (docs): change subcommand generation for nested subcommands 2022-10-24 02:47:33 +00:00
Kai Armstrong f95b6ea90c docs: add linting and checks to documentation 2022-10-21 14:38:48 +00:00
Gary Holtz 74f5004d57 Merge branch 'phikai-docs-comments' into 'main'
fix (docs): Correct HTML comment syntax

Closes #1075

See merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1056

Merged-by: Gary Holtz <gholtz@gitlab.com>
Approved-by: Gary Holtz <gholtz@gitlab.com>
Co-authored-by: Kai Armstrong <karmstrong@gitlab.com>
2022-10-19 14:32:40 +00:00
Kai Armstrong 12349e251f fix (docs): Correct HTML comment syntax 2022-10-19 14:32:40 +00:00
Clement Sam f4c9b6f20e fix: avoid prompting for remotes in non-TTY 2022-10-18 01:31:57 +00:00
Kai Armstrong 20b6d07607 docs: convert documentation to markdown 2022-10-17 17:46:38 +00:00
Oscar Tovar 40a5436789 chore: update module path 2022-09-19 20:23:45 +00:00
Clement Sam 40c8f6760e fix(check-update): check latest release from GitLab
Currently the check-update command which checks for
latest glab releases, checks from the releases page
of the old GitHub repo.

This MR changes this behaviour to check releases
from the new gitlab-org/cli repo.
2022-08-10 18:58:23 +00:00
Rob Hoelz 2eba4de79a
Add support for terminal hyperlinks (#852)
* feat: Add ground work for supporting hyperlinks to iostreams

See GH #812

See https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
for technical details behind the hyperlink escape sequence

For now hyperlinks are enabled as long as long as standard output is a
TTY - we'll want to add some additional detection/flags down the road

* feat: use terminal hyperlinks when listing issues/MRs

See GH #812

* feat(hyperlinks): Add display_hyperlinks config option

* chore(hyperlinks): Clean up Hyperlink API a bit

* feat(hyperlinks): default hyperlinks to off

I think hyperlink display should default to off while the feature is new
so that users can play with it

* feat(hyperlinks): Implement FORCE_HYPERLINKS

Setting the FORCE_HYPERLINKS environment variable forces glab to render
hyperlinks when it can - otherwise, it falls back to display_hyperlinks
from the config, which tells glab whether or not to enable hyperlinks
based on whether or not we're outputting to a TTY.

* fix(hyperlink): accommodate hyperlink OSC in string stripping

* fix: Fix incorrect web_url in fixture data

* test(hyperlink): Add tests for hyperlinks in issues list

* test(hyperlink): Add tests for truncating text with hyperlink OSC

* fix(hyperlinks): accommodate hyperlinks in Truncate

* test(hyperlinks): Add tests for showing hyperlinks in mr list

* docs(hyperlink): Add docs for FORCE_HYPERLINKS and display_hyperlinks

* fix(hyperlinks): simplify truncate algorithm

…while also fixing tableprinter tests, which expect that the first
grapheme provided to Truncate is always preserved

* fix(hyperlinks): Deactivate hyperlinks in auto mode if we're writing to a pager
2021-10-27 09:41:35 +00:00
Rob Hoelz 7d0992432b chore: use errors.Is instead of error equality
This might be needlessly pedantic, but it insulates against potential
future changes in error wrapping
2021-10-03 09:49:42 -05:00
addshore b8928008b5 Move glinstance to pkg 2021-09-24 18:51:08 +01:00
Clement Sam f636f0b13e fix test 2021-05-23 03:17:18 +00:00
Clement Sam af5ba63dc6 interactive options and better error handling 2021-05-23 02:51:23 +00:00
Clement Sam e5cf7c3143 scriptability: Avoid truncating columns of tables/lists on non-TTYs
This is a hot fix to solve where glab still truncates lines with length longer that the specified column width on non-TTYs to improve scriptability

Resolves #706
2021-05-12 00:43:54 +00:00
Clement Sam 70ea685827 Allow protocol override when overriding the default host
This allows overriding the default protocol of the hostname if a fully qualified url is provided when using the `GITLAB_HOST` environment variable.
For example, if the GITLAB_HOST=http://my.glinstance.org, then the host will be set to my.glinstance.org and the protocol become http, unlike before when the protocol was ignored and only the hostname was considered.

This is a follow-up for #678
and #667
2021-04-30 06:42:11 +00:00
Alberts Zemzale b520c9c8ac fix(main): Allow host override with full URLs
When trying to override host with full URLs, config key lookups would
fail. This came down to the fact that we use `my.gitlab.com` as config
key and when providing override as `https://my.gitlab.com/` it would
fail to find this config key.

Issue #592
2021-04-28 13:52:08 +03:00
Alberts Zemzale 7e9e9e80c0
fix(main): OverrideDefault using base repo host
When using flags/commands that override the repo, but don't supply
hostname, we allways fallback to `gitlab.com`. This is a problem for
commands like `mr checkout 12 -R OWNER/REPO` that should use API host
`self-hosted`, but actually use `gitlab.com`.

Now we override default host, from the base repo, if one is found.
Environment values still override repo host.
2021-04-08 09:40:00 +03:00
Clement Sam 4c1fef01d8 fix: respect GLAB_PAGER in config and env vars
Resolves #320 Resolves #656
2021-03-15 11:47:28 +00:00
Clement Sam 961b8a3c3a Override survey's choice of color for default values
For default values for e.g.  prompts, Survey uses the literal white color, which makes no sense on dark terminals and is literally invisible on light backgrounds.

This overrides Survey to output a gray color for 256-color terminals and default for basic terminals.
2021-03-10 21:20:43 +00:00
Clement Sam a8ac704ccd refactor: move internal/utils package to pkg/utils 2021-01-29 08:40:52 +00:00
Clement Sam 8352f6e427 reasonably change iostream methods
Change iostreams methods names and references
2021-01-28 23:07:05 +00:00
Clement Sam e4acafd006 refactor: move iostreams to own separate package
- Move iostreams to own separate package
- Fix references to iostream package
- Add StartSpinner and StopSpinner methods
2021-01-28 22:38:32 +00:00
Clement Sam a7b60d9efd feat(cmd/gen-docs): manpage generation from cobra
Closes #580
2021-01-18 23:06:25 +00:00
Clement Sam 56bdf53432 fix: avoid printing unnecessary blank newlines
Closes #391
2021-01-05 16:23:07 +00:00
Leo a2efea805a test(cmd/glab/main): test path where debug is active 2021-01-05 04:50:08 -03:00
Leo 819e1102f1 refactor(cmd/gen-docs): replace .Replace(... -1) with .ReplaceAll
https://deepsource.io/gh/profclems/glab/run/038a4af3-c4d4-41ee-9272-81b12a2bb6e7/go/CRT-A0010/
2020-12-28 07:29:55 -03:00
Leo 65d85b4c57 refactor(cmd/gen-docs): fix string length check
https://deepsource.io/gh/profclems/glab/run/038a4af3-c4d4-41ee-9272-81b12a2bb6e7/go/CRT-A0004/
2020-12-28 07:29:55 -03:00
Leo b0f45afc96 feat(cmd/gen-docs): fix directory permissions and unused variable
https://deepsource.io/gh/profclems/glab/run/038a4af3-c4d4-41ee-9272-81b12a2bb6e7/go/GSC-G301/
https://deepsource.io/gh/profclems/glab/run/038a4af3-c4d4-41ee-9272-81b12a2bb6e7/go/SCC-SA4006/
2020-12-28 07:29:55 -03:00
Clement Sam ff2e936599 fix incorrect version info on check-update
Fixes #282
2020-11-16 16:29:31 +00:00
Clement Sam 7506a8a837 Redesign Tableprinter to adjust content based on terminal size 2020-11-13 12:24:07 +00:00
Clement Sam aea733a6d9 style: reformat version output 2020-11-12 13:14:13 +00:00
Clement Sam 4866d691da
docs: switch from md to rst (#280)
* docs: switch from md to rst

* set master_doc to index

* clean up
2020-10-26 12:55:03 +00:00
Clement Sam de8322f6fc
feat: glab auth login (#277)
* respect NO_PROMPT env var

* feat: glab auth login

* 🧹🔥 api client

* add tests

* linting

* fix tests

* add non-sensitive token for test to work
2020-10-25 11:31:01 +00:00
Clement Sam 74b2d8e189
fix(config): respect api_protocol in config (#275)
* fix(config): respect api_protocol in config

Fixes #270

* fix lint errors
2020-10-21 13:01:04 +00:00
Clement Sam d2b92f9ae7 add pager support to mr list 2020-10-14 20:24:54 +00:00
Clement Sam 53f98c16b5
feat: detect MR for current branch (#264)
* feat: detect MR for current branch

* fix lint errors

* fix error on test

* fix error on test
2020-10-14 15:09:20 +00:00
Clement Sam d71e3d8f89
chore(ci): use golangci action (#256)
* chore(ci): use golangci action

* Update lint.yml

* Update lint.yml

* fix lint chore

* fix lint errors

* fix lint errors

* disable travis buddy to reduce noise
2020-10-07 21:12:12 +00:00