mirror of https://github.com/databricks/cli.git
fix: More explicit names and descriptions for `annotationHandler.sync` method
This commit is contained in:
parent
304918436e
commit
00376711a3
|
@ -109,8 +109,8 @@ func (d *annotationHandler) addAnnotations(typ reflect.Type, s jsonschema.Schema
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds empty annotations with placeholders to the annotation file
|
// Writes missing annotations with placeholder values back to the annotation file
|
||||||
func (d *annotationHandler) sync(outputPath string) error {
|
func (d *annotationHandler) syncWithMissingAnnotations(outputPath string) error {
|
||||||
existingFile, err := os.ReadFile(outputPath)
|
existingFile, err := os.ReadFile(outputPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -163,7 +163,8 @@ func generateSchema(workdir, outputFile string) {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = a.sync(annotationsPath)
|
// Overwrite the input annotation file, adding missing annotations
|
||||||
|
err = a.syncWithMissingAnnotations(annotationsPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue