Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auto-generated warning in generated docs; update unit test #140

Merged
merged 3 commits into from
Aug 21, 2023
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: 7 additions & 0 deletions pkg/tools/gen/gendoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ name of the person
## Source Files

- [models.Person](models/person.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
`,
expectWindows: `## Schema Person

Expand All @@ -72,6 +74,8 @@ name of the person
## Source Files

- [models.Person](models\person.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
`,
},
}
Expand Down Expand Up @@ -202,6 +206,9 @@ func CompareDir(a string, b string) error {
)
}
}
if len(linesA) < len(linesB) {
return fmt.Errorf("file content different, contains more lines in file %s:%v - %v:\n%s", aPath, len(linesA), len(linesB), strings.Join(linesB[len(linesA):], "\n"))
}
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/gen/templates/doc/packageDoc.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
{{range $index, $schema := sortSchemas .Schemas}}- [{{$schema.KclExtensions.XKclModelType.Type}}]({{$schema.KclExtensions.XKclModelType.Type}}.md)

{{end -}}

{{- end}}
<!-- Auto generated by kcl-doc tool, please do not edit. -->
{{end}}
2 changes: 2 additions & 0 deletions pkg/tools/gen/templates/doc/schemaDoc.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
## Source Files

- [{{fullTypeName . }}]({{sourcePath .}})

<!-- Auto generated by kcl-doc tool, please do not edit. -->
{{end}}
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/pkg/unixlike/md/Container.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ The name of the long-running container.
## Source Files

- [Container](container.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/pkg/unixlike/md/Server.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ See also: kusion_models/core/v1/workload_metadata.k.
## Source Files

- [Server](server.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
1 change: 1 addition & 0 deletions pkg/tools/gen/testdata/doc/pkg/unixlike/md/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

- [Server](Server.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/pkg/unixlike/md/k8s/Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [k8s.Deployment](k8s/deployment.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
1 change: 1 addition & 0 deletions pkg/tools/gen/testdata/doc/pkg/unixlike/md/k8s/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

- [Deployment](Deployment.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/pkg/windows/md/Container.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ The name of the long-running container.
## Source Files

- [Container](container.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/pkg/windows/md/Server.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ See also: kusion_models/core/v1/workload_metadata.k.
## Source Files

- [Server](server.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
1 change: 1 addition & 0 deletions pkg/tools/gen/testdata/doc/pkg/windows/md/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

- [Server](Server.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/pkg/windows/md/k8s/Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [k8s.Deployment](k8s\deployment.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
1 change: 1 addition & 0 deletions pkg/tools/gen/testdata/doc/pkg/windows/md/k8s/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

- [Deployment](Deployment.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/reimport/unixlike/md/A.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [A](a.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/reimport/unixlike/md/B.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [B](b.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
1 change: 1 addition & 0 deletions pkg/tools/gen/testdata/doc/reimport/unixlike/md/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

- [B](B.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [k8s.Deployment](k8s/deployment.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

- [Deployment](Deployment.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/reimport/windows/md/A.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [A](a.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 2 additions & 0 deletions pkg/tools/gen/testdata/doc/reimport/windows/md/B.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [B](b.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
1 change: 1 addition & 0 deletions pkg/tools/gen/testdata/doc/reimport/windows/md/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

- [B](B.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
## Source Files

- [k8s.Deployment](k8s\deployment.k)

<!-- Auto generated by kcl-doc tool, please do not edit. -->
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

- [Deployment](Deployment.md)

<!-- Auto generated by kcl-doc tool, please do not edit. -->