Nicolas
f538c05282
refactor: code cleanup across codebase ( #947 )
...
## Summary
- Extract duplicate \`getReleaseByTag\` into shared \`cmd/releases/utils.go\`
- Replace \`log.Fatal\` calls with proper error returns in config and login commands; \`GetLoginByToken\`/\`GetLoginsByHost\`/\`GetLoginByHost\` now return errors
- Remove dead \`portChan\` channel in \`modules/auth/oauth.go\`
- Fix YAML integer detection to use \`strconv.ParseInt\` (correctly handles negatives and large ints)
- Fix \`path.go\` error handling to use \`errors.As\` + \`syscall.ENOTDIR\` instead of string comparison
- Extract repeated credential helper key into local variable in \`SetupHelper\`
- Use existing \`isRemoteDeleted()\` in \`pull_clean.go\` instead of duplicating the logic
- Fix ~30 error message casing violations to follow Go conventions
- Use \`fmt.Errorf\` consistently instead of string concatenation in \`generic.go\`
Reviewed-on: https://gitea.com/gitea/tea/pulls/947
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com >
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com >
Co-authored-by: Nicolas <bircni@icloud.com >
Co-committed-by: Nicolas <bircni@icloud.com >
2026-04-08 03:38:49 +00:00
techknowlogick
b05e03416b
replace log.Fatal/os.Exit with error returns ( #941 )
...
* Use stdlib encoders
* Reduce some duplication
* Remove global pagination state
* Dedupe JSON detail types
* Bump golangci-lint
Reviewed-on: https://gitea.com/gitea/tea/pulls/941
Co-authored-by: techknowlogick <techknowlogick@gitea.com >
Co-committed-by: techknowlogick <techknowlogick@gitea.com >
2026-03-27 03:36:44 +00:00
Lunny Xiao
6acb29efd7
Fix yaml output single quote ( #814 )
...
Fix #659
Reviewed-on: https://gitea.com/gitea/tea/pulls/814
2025-09-14 00:23:12 +00:00
Lunny Xiao
d3c73cd5dc
Fix bug when output json with special chars ( #801 )
...
Fix #800
Reviewed-on: https://gitea.com/gitea/tea/pulls/801
2025-09-10 20:36:27 +00:00
techknowlogick
d4887f6b9d
Bump Table Dep ( #757 )
...
Reviewed-on: https://gitea.com/gitea/tea/pulls/757
Co-authored-by: techknowlogick <techknowlogick@gitea.com >
Co-committed-by: techknowlogick <techknowlogick@gitea.com >
2025-05-13 21:03:46 +00:00
techknowlogick
b868d30434
spdx ( #581 )
...
Co-authored-by: techknowlogick <hello@techknowlogick.com >
Co-committed-by: techknowlogick <hello@techknowlogick.com >
2023-09-08 01:40:02 +00:00
appleboy
b02263adb0
refactor: improve code quality and efficiency in various files ( #548 )
...
- Replace loadConfig() with _ = loadConfig()
- Update file permissions from 0660 to 0o660
- Simplify variable declarations
- Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term
- Remove unused getCertPrincipals function
- Replace time.Now().Sub() with time.Since()
- Add test for ArgToIndex function
Signed-off-by: appleboy <appleboy.tw@gmail.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Reviewed-on: https://gitea.com/gitea/tea/pulls/548
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com >
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io >
Co-authored-by: appleboy <appleboy.tw@gmail.com >
Co-committed-by: appleboy <appleboy.tw@gmail.com >
2023-04-30 11:43:26 +08:00
6543
a37377d181
Add "json" as output type ( #513 )
...
Co-authored-by: Norwin <git@nroo.de >
Reviewed-on: https://gitea.com/gitea/tea/pulls/513
Reviewed-by: Norwin <noerw@noreply.gitea.io >
Reviewed-by: strk <strk@noreply.gitea.io >
2022-09-27 23:39:47 +08:00
Norwin
d8f4273ed0
Add TSV to machine-readable formats ( #467 )
...
...so no ansi formatting (colors) is emitted in that format (eg `tea labels -o tsv`)
Co-authored-by: Norwin <git@nroo.de >
Co-authored-by: 6543 <6543@obermui.de >
Reviewed-on: https://gitea.com/gitea/tea/pulls/467
Reviewed-by: 6543 <6543@obermui.de >
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: Norwin <noerw@noreply.gitea.io >
Co-committed-by: Norwin <noerw@noreply.gitea.io >
2022-03-13 12:00:21 +08:00
justusbunsi
3cf084cb96
PR listing: add --fields & expose additional fields ( #415 )
...
This PR adds the `--fields` flag to `tea pr ls` (#342 ), and exposes more fields specific to the `PullRequest` type:
```
--fields value, -f value Comma-separated list of fields to print.
Available values:
index,state,author,author-id,url,title,body,mergeable,base,base-commit,head,diff,patch,created,updated,deadline,assignees,milestone,labels,comments
(default: "index,title,state,author,milestone,updated,labels")
```
Co-authored-by: justusbunsi <61625851+justusbunsi@users.noreply.github.com >
Co-authored-by: Norwin <git@nroo.de >
Reviewed-on: https://gitea.com/gitea/tea/pulls/415
Reviewed-by: Norwin <noerw@noreply.gitea.io >
Reviewed-by: techknowlogick <techknowlogick@gitea.io >
Reviewed-by: 6543 <6543@obermui.de >
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io >
Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io >
2021-09-29 04:36:33 +08:00
Norwin
9efee7bf99
Add tea issues --fields, allow printing labels ( #312 )
...
generalize list printing with dynamic fields
refactor print.IssuesList to use tableFromItems()
preparatory refactor
print.IssuesList: allow printing labels
move formatters to formatters.go
expose more printable fields on issue
add generic flags.FieldsFlag
add fields flag to tea issues, tea ms issues
validate provided fields
add strict username, or formatted user fields
change default fields
tea issues -> replace updated with labels
tea ms issues -> replace author with labels, reorder
Validate provided fields
Co-authored-by: Norwin Roosen <git@nroo.de >
Co-authored-by: 6543 <6543@obermui.de >
Reviewed-on: https://gitea.com/gitea/tea/pulls/312
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com >
Reviewed-by: 6543 <6543@obermui.de >
Co-Authored-By: Norwin <noerw@noreply.gitea.io >
Co-Committed-By: Norwin <noerw@noreply.gitea.io >
2020-12-21 23:41:07 +08:00
Norwin
a91168fd36
Improved list output ( #281 )
...
remove unused debug var
move outputList into a struct
so we can add additional functionality for all list output
rename list output to table.go
make table sortable
sort milestones
sort milestones descending
remove unnecessary if
Co-authored-by: Norwin Roosen <git@nroo.de >
Reviewed-on: https://gitea.com/gitea/tea/pulls/281
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io >
Reviewed-by: 6543 <6543@obermui.de >
Co-Authored-By: Norwin <noerw@noreply.gitea.io >
Co-Committed-By: Norwin <noerw@noreply.gitea.io >
2020-12-10 06:04:36 +08:00