Skip to content

Commit 9cbbdf8

Browse files
authored
docs: updated ROADMAP, quick index (#104)
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 737a67b commit 9cbbdf8

9 files changed

Lines changed: 70 additions & 50 deletions

File tree

.mdsf.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ Feedback, contributions and proposals are welcome.
6060

6161
> **Recent news**
6262
>
63-
> ✅ Preparing v2.5.0: new features, a few fixes (`EventuallyWithT`)
63+
> ✅ Preparing v2.5.0: new features: support for synctest, NoFileDescriptorLeak for macos,
64+
> plus a few fixes (`EventuallyWithT`, `Subset`).
6465
>
6566
> See also our [ROADMAP][doc-roadmap].
6667

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This policy outlines the commitment and practices of the go-openapi maintainers
66

77
| Version | Supported |
88
| ------- | ------------------ |
9-
| 2.2.x | :white_check_mark: |
9+
| 2.4.x | :white_check_mark: |
1010

1111
## Vulnerability checks in place
1212

codegen/internal/generator/doc_generator.go

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (d *DocGenerator) buildIndexDocument(docsByDomain iter.Seq2[string, model.D
184184
}
185185

186186
doc.RefCount = len(doc.Index)
187-
doc.Metrics = buildMetrics(docsByDomain)
187+
doc.Metrics = d.buildMetrics(docsByDomain)
188188
doc.QuickIndex = buildQuickIndex(docsByDomain)
189189

190190
return doc
@@ -209,7 +209,7 @@ func buildIndexEntries(docsByDomain iter.Seq2[string, model.Document]) []model.I
209209
return entries
210210
}
211211

212-
func buildMetrics(docsByDomain iter.Seq2[string, model.Document]) (metrics model.Metrics) {
212+
func (d *DocGenerator) buildMetrics(docsByDomain iter.Seq2[string, model.Document]) (metrics model.Metrics) {
213213
metrics.ByDomain = make(map[string]model.DomainMetrics)
214214

215215
for domain, doc := range docsByDomain {
@@ -240,7 +240,28 @@ func buildMetrics(docsByDomain iter.Seq2[string, model.Document]) (metrics model
240240
metrics.ByDomain[domain] = domainMetrics
241241
}
242242

243-
metrics.NonGenerics = metrics.Functions - metrics.Generics
243+
metrics.NonGenerics = metrics.Assertions - metrics.Generics
244+
variantsMultiplier := 1
245+
genericsVariantsMultiplier := 1
246+
247+
if d.ctx.enableForward {
248+
variantsMultiplier++
249+
if d.ctx.enableFormat {
250+
variantsMultiplier++
251+
}
252+
}
253+
254+
if d.ctx.enableFormat {
255+
variantsMultiplier++
256+
genericsVariantsMultiplier++
257+
}
258+
259+
metrics.PackageVariants = metrics.NonGenerics*variantsMultiplier + metrics.Generics*genericsVariantsMultiplier
260+
261+
// caveat: assume 2 target packages (not really available from options atm).
262+
const generatedPackages = 2
263+
metrics.TotalVariants = generatedPackages * metrics.PackageVariants
264+
metrics.TotalFunctions = generatedPackages * (metrics.PackageVariants + metrics.Helpers + 1) // add the Assertion constructor.
244265

245266
return metrics
246267
}

codegen/internal/generator/templates/doc_metrics.md.gotmpl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ All assertions are classified into **{{ .Domains }}** domains to help navigate t
1313

1414
## API metrics
1515

16-
Counts for core functionality, excluding variants (formatted, forward, forward-formatted).
17-
18-
| Kind | Count |
19-
| ------------------------ | ----------------- |
20-
| All functions | {{ .Functions }} |
21-
| All core assertions | {{ .Assertions }} |
22-
| Generic assertions | {{ .Generics }} |
23-
| Helpers (not assertions) | {{ .Helpers }} |
24-
| Others | {{ .Others }} |
16+
Counts for core functionality, and generated variants (formatted, forward, forward-formatted).
17+
18+
| Kind | Count | Note |
19+
| ------------------------- | ----------------- | ---- |
20+
| All core functions | {{ .Functions }} | Maintained core |
21+
| All core assertions | {{ .Assertions }} | Usage with `*testing.T` |
22+
| Generic assertions | {{ .Generics }} | Type-safe assertions ("T" suffix) |
23+
| Helpers (not assertions) | {{ .Helpers }} | General-purpose utilities, not assertions |
24+
| Others | {{ .Others }} | |
25+
| assert/require variants | {{ .PackageVariants }} | Generated variants |
26+
| Total assertions variants | {{ .TotalVariants }} | Available assertions API |
27+
| Total API surface | {{ .TotalFunctions }} | |
2528

2629
{{- end }}
2730

codegen/internal/model/documentation.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,17 @@ type IndexEntry struct {
151151

152152
//nolint:tagliatelle // not using camelcase
153153
type Metrics struct {
154-
Domains int `yaml:"domains"`
155-
Functions int `yaml:"functions"`
156-
Assertions int `yaml:"assertions"`
157-
Generics int `yaml:"generics"`
158-
NonGenerics int `yaml:"nongeneric_assertions"`
159-
Helpers int `yaml:"helpers"`
160-
Others int `yaml:"others"`
161-
ByDomain map[string]DomainMetrics `yaml:"by_domain"`
154+
Domains int `yaml:"domains"`
155+
Functions int `yaml:"functions"`
156+
Assertions int `yaml:"assertions"`
157+
Generics int `yaml:"generics"`
158+
NonGenerics int `yaml:"nongeneric_assertions"`
159+
Helpers int `yaml:"helpers"`
160+
Others int `yaml:"others"`
161+
ByDomain map[string]DomainMetrics `yaml:"by_domain"`
162+
PackageVariants int `yaml:"package_variants"`
163+
TotalVariants int `yaml:"total_variants"`
164+
TotalFunctions int `yaml:"total_functions"`
162165
}
163166

164167
type DomainMetrics struct {

docs/doc-site/api/metrics.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ All assertions are classified into **19** domains to help navigate the API, depe
1111

1212
## API metrics
1313

14-
Counts for core functionality, excluding variants (formatted, forward, forward-formatted).
14+
Counts for core functionality, and generated variants (formatted, forward, forward-formatted).
1515

16-
| Kind | Count |
17-
| ------------------------ | ----------------- |
18-
| All functions | 135 |
19-
| All core assertions | 131 |
20-
| Generic assertions | 50 |
21-
| Helpers (not assertions) | 4 |
22-
| Others | 0 |
16+
| Kind | Count | Note |
17+
| ------------------------- | ----------------- | ---- |
18+
| All core functions | 135 | Maintained core |
19+
| All core assertions | 131 | Usage with `*testing.T` |
20+
| Generic assertions | 50 | Type-safe assertions ("T" suffix) |
21+
| Helpers (not assertions) | 4 | General-purpose utilities, not assertions |
22+
| Others | 0 | |
23+
| assert/require variants | 424 | Generated variants |
24+
| Total assertions variants | 848 | Available assertions API |
25+
| Total API surface | 858 | |
2326

2427
## Quick index
2528

docs/doc-site/project/maintainers/ARCHITECTURE.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ All these variants make up several hundreds functions, which poses a challenge f
5555

5656
We have adopted code and documentation generation as a mean to mitigate this issue.
5757

58-
#### Current (v2.3.0-unreleased)
58+
#### Current (v2.5.0-unreleased)
5959

6060
1. Generic assertions (with type parameters): {{% siteparam "metrics.generics" %}} functions
6161
2. Non-generic assertions (with t T parameter, no type parameters): {{% siteparam "metrics.nongeneric_assertions" %}} functions
@@ -65,12 +65,11 @@ We have adopted code and documentation generation as a mean to mitigate this iss
6565

6666
**Generated Functions**
6767

68-
1. Generic assertions: {{% siteparam "metrics.generated_generic" %}}
69-
2. Non-generic assertions: {{% siteparam "metrics.generated_nongeneric" %}}
70-
3. Helper functions: {{% siteparam "metrics.generated_helpers" %}}
71-
4. Constructors: 2
68+
1. Generated variants in each package (assert/require): {{% siteparam "metrics.package_variants" %}}
69+
2. Helpers: {{% siteparam "metrics.helpers" %}}
70+
3. Constructors: 2 (1 in assert, 1 in require)
7271

73-
Total: {{% siteparam "metrics.generated_total" %}} functions
72+
Overall: {{% siteparam "metrics.total_functions" %}} generated functions
7473

7574
## Architecture Overview
7675

hack/doc-site/hugo/metrics.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ params:
44
functions: 135
55
assertions: 131
66
generics: 50
7-
nongeneric_assertions: 85
7+
nongeneric_assertions: 81
88
helpers: 4
99
others: 0
1010
by_domain:
@@ -65,3 +65,6 @@ params:
6565
yaml:
6666
name: Yaml
6767
count: 5
68+
package_variants: 424
69+
total_variants: 848
70+
total_functions: 858

0 commit comments

Comments
 (0)