Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
codecov:
notify:
after_n_builds: 2

coverage:
status:
patch:
default:
target: 80%
ignore:
- internal/scantest
- fixtures
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
# so byte-level comparison doesn't trip on Windows checkouts that
# default to core.autocrlf=true.
*.json text eol=lf
*.txt text eol=lf
internal/parsers/grammar/grammar_test/testdata/golden/* text eol=lf
fixtures/integration/golden/* text eol=lf
6 changes: 5 additions & 1 deletion .github/workflows/toolchain-independence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.0 # fixtures source (FixturesDir resolves the build-time checkout path, identical across jobs)
# oldstable is a DIFFERENT minor than job A's stable, so its GOROOT lives at a different path.
#
# It must satisfy the fixtures module's `go` directive (currently go 1.25.0); oldstable only ever increases, so this holds going forward.
# It must satisfy the fixtures module's `go` directive (currently go 1.25.8, aligned with the
# rest of the workspace because go-openapi/core/json declares go 1.25.8). The floor moved by a
# PATCH, not a minor, so oldstable still satisfies it: oldstable resolves to the latest patch
# of the previous minor, and that is >= any released patch of it. Holds going forward, since
# oldstable only ever increases.
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: oldstable
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ profile.cov
# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace: commit go.work, ignore the generated checksum file
go.work.sum

# env file
.env

Expand Down
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ linters:
- gomoddirectives # mono-repo, multi-modules (docs/examples): local replace directives are needed for proper releasing
- goconst # disabled, perhaps temporarily as this linter has become way too pick and noisy
- godox
- gomoddirectives
- gomodguard
- gomodguard_v2
- exhaustruct
Expand Down Expand Up @@ -54,6 +55,25 @@ linters:
- third_party$
- builtin$
- examples$
rules:
# cmd/genspec-tui is a bubbletea front-end. These four disagree with the
# shape of TUI code rather than with the code itself, and each fires often
# enough (102 between them) that //nolint would be the scattering this
# repo's linting rule tells us to avoid. Scoped by path so the library
# keeps all four.
- path: cmd/genspec-tui/
linters:
# Layout arithmetic, where the number IS the explanation: w-2 is the
# two border columns, h-3 is border plus title row.
- mnd
# Key, mouse and message switches read open-ended INPUT, not a closed
# domain. Falling through to the code after the switch is the
# behaviour, so a required `default:` would be an empty statement
# asserting nothing. The scanner's go/types switches still get this.
- exhaustive
# clamp/clampInt keep a general (v, lo, hi) signature though every
# call site happens to pass lo=0.
- unparam
formatters:
enable:
- gofmt
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Supports Go modules (since go1.11).

## Announcements

* **2025-04-19** : large package layout reshuffle
* **2026-07-31** : landed a new spec generation TUI tool

* **2026-04-19** : large package layout reshuffle
* the entire project is being refactored to restore a reasonable level of maintenability
* the only exposed API is Run() and Options.

Expand All @@ -32,7 +34,7 @@ API is stable.
go get github.com/go-openapi/codescan
```

## Basic usage
## Basic usage as a library

```go
import (
Expand All @@ -44,6 +46,22 @@ swaggerSpec, err := codescan.Run(&codescan.Options{
})
```

## Work with the TUI

This project comes with a terminal UI to quickly render a Swagger spec from source
and navigate your code annotations. It shows diagnostics and you may test the impact
of the various available options.

```cmd
go install github.com/go-openapi/codescan/cmd/genspec-tui@latest
```

```cmd
genspec-tui -workdir [my source location]
```

![tui_screenshot](docs/genspec-tui.png)

## Change log

See <https://github.com/go-openapi/codescan/releases>
Expand Down
Loading
Loading