code: func (vr *validateRun) validateGenerated(ctx context.Context, path string) (*validateResult, error) {
  	// -config-set flag must not be used in this mode, config sets are defined
  	// on Starlark level.
  	if vr.configSet != "" {
  		return nil, base.NewCLIError("-config-set can't be used when validating Starlark-based configs")
  	}
  
  	meta := vr.DefaultMeta()
  	output, err := base.GenerateConfigs(ctx, path, &meta, &vr.Meta)
  	if err != nil {
  		return nil, err
  	}
  
  	result := &validateResult{}
  
  	if meta.ConfigDir != "-" {
  		// Find files that are present on disk, but no longer in the output.
  		tracked, err := lucicfg.FindTrackedFiles(meta.ConfigDir, meta.TrackedFiles)
  		if err != nil {
  			return result, err
  		}
  		for _, f := range tracked {
  			if _, present := output.Data[f]; !present {
  				result.Stale = append(result.Stale, f)
  			}
  		}
  		// Find files that are newer in the output or do not exist on disk.
  		changed, _ := output.Compare(meta.ConfigDir)
  		result.Stale = append(result.Stale, changed...)
  	}
  
  	if len(result.Stale) != 0 {
  		return result, fmt.Errorf(
  			"following files on disk are out-of-date: %s.\n"+
  				"  Run `lucicfg generate %q` to update them",
  			strings.Join(result.Stale, ", "), path)
  	}
  
  	// Validate via LUCI Config RPC. This silently skips configs not belonging to
  	// any config sets.
  	result.Validation, err = base.ValidateOutput(
  		ctx,
  		output,
  		vr.ConfigService,
  		meta.ConfigServiceHost,
  		meta.FailOnWarnings)
  	return result, err
  }
docs: // validateGenerated executes Starlark script, compares the result to whatever
  // is on disk (failing the validation if there's a difference), and then sends
  // the output to LUCI Config service for validation.