Skip to content

Commit 121e6ed

Browse files
authored
Merge pull request #38 from fredbi/feat/genspec-tui
Feat/genspec tui
2 parents 4a5d5e8 + e25ad92 commit 121e6ed

65 files changed

Lines changed: 10846 additions & 9 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.codecov.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
codecov:
2+
notify:
3+
after_n_builds: 2
4+
15
coverage:
26
status:
37
patch:
48
default:
59
target: 80%
6-
ignore:
7-
- internal/scantest
8-
- fixtures

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
# so byte-level comparison doesn't trip on Windows checkouts that
33
# default to core.autocrlf=true.
44
*.json text eol=lf
5+
*.txt text eol=lf
56
internal/parsers/grammar/grammar_test/testdata/golden/* text eol=lf
67
fixtures/integration/golden/* text eol=lf

‎.github/workflows/toolchain-independence.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ jobs:
7878
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.0 # fixtures source (FixturesDir resolves the build-time checkout path, identical across jobs)
7979
# oldstable is a DIFFERENT minor than job A's stable, so its GOROOT lives at a different path.
8080
#
81-
# It must satisfy the fixtures module's `go` directive (currently go 1.25.0); oldstable only ever increases, so this holds going forward.
81+
# It must satisfy the fixtures module's `go` directive (currently go 1.25.8, aligned with the
82+
# rest of the workspace because go-openapi/core/json declares go 1.25.8). The floor moved by a
83+
# PATCH, not a minor, so oldstable still satisfies it: oldstable resolves to the latest patch
84+
# of the previous minor, and that is >= any released patch of it. Holds going forward, since
85+
# oldstable only ever increases.
8286
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
8387
with:
8488
go-version: oldstable

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ profile.cov
2020
# Dependency directories (remove the comment below to include it)
2121
# vendor/
2222

23+
# Go workspace: commit go.work, ignore the generated checksum file
24+
go.work.sum
25+
2326
# env file
2427
.env
2528

‎.golangci.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ linters:
77
- gomoddirectives # mono-repo, multi-modules (docs/examples): local replace directives are needed for proper releasing
88
- goconst # disabled, perhaps temporarily as this linter has become way too pick and noisy
99
- godox
10+
- gomoddirectives
1011
- gomodguard
1112
- gomodguard_v2
1213
- exhaustruct
@@ -54,6 +55,25 @@ linters:
5455
- third_party$
5556
- builtin$
5657
- examples$
58+
rules:
59+
# cmd/genspec-tui is a bubbletea front-end. These four disagree with the
60+
# shape of TUI code rather than with the code itself, and each fires often
61+
# enough (102 between them) that //nolint would be the scattering this
62+
# repo's linting rule tells us to avoid. Scoped by path so the library
63+
# keeps all four.
64+
- path: cmd/genspec-tui/
65+
linters:
66+
# Layout arithmetic, where the number IS the explanation: w-2 is the
67+
# two border columns, h-3 is border plus title row.
68+
- mnd
69+
# Key, mouse and message switches read open-ended INPUT, not a closed
70+
# domain. Falling through to the code after the switch is the
71+
# behaviour, so a required `default:` would be an empty statement
72+
# asserting nothing. The scanner's go/types switches still get this.
73+
- exhaustive
74+
# clamp/clampInt keep a general (v, lo, hi) signature though every
75+
# call site happens to pass lo=0.
76+
- unparam
5777
formatters:
5878
enable:
5979
- gofmt

‎README.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Supports Go modules (since go1.11).
1818

1919
## Announcements
2020

21-
* **2025-04-19** : large package layout reshuffle
21+
* **2026-07-31** : landed a new spec generation TUI tool
22+
23+
* **2026-04-19** : large package layout reshuffle
2224
* the entire project is being refactored to restore a reasonable level of maintenability
2325
* the only exposed API is Run() and Options.
2426

@@ -32,7 +34,7 @@ API is stable.
3234
go get github.com/go-openapi/codescan
3335
```
3436

35-
## Basic usage
37+
## Basic usage as a library
3638

3739
```go
3840
import (
@@ -44,6 +46,22 @@ swaggerSpec, err := codescan.Run(&codescan.Options{
4446
})
4547
```
4648

49+
## Work with the TUI
50+
51+
This project comes with a terminal UI to quickly render a Swagger spec from source
52+
and navigate your code annotations. It shows diagnostics and you may test the impact
53+
of the various available options.
54+
55+
```cmd
56+
go install github.com/go-openapi/codescan/cmd/genspec-tui@latest
57+
```
58+
59+
```cmd
60+
genspec-tui -workdir [my source location]
61+
```
62+
63+
![tui_screenshot](docs/genspec-tui.png)
64+
4765
## Change log
4866

4967
See <https://github.com/go-openapi/codescan/releases>

0 commit comments

Comments
 (0)