File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ func (c *ConfigType) Runtimes() map[string]*plugins.RuntimeInfo {
6969 return c .runtimes
7070}
7171
72- // readOrCreateConfig reads the existing YAML config or creates a new one
73- func (c * ConfigType ) readOrCreateConfig (codacyPath string ) (map [string ]interface {}, error ) {
72+ // loadConfigOrInitializeEmpty reads the existing YAML config or returns an empty configuration if the file doesn't exist
73+ func (c * ConfigType ) loadConfigOrInitializeEmpty (codacyPath string ) (map [string ]interface {}, error ) {
7474 content , err := os .ReadFile (codacyPath )
7575 if err != nil && ! os .IsNotExist (err ) {
7676 return nil , fmt .Errorf ("error reading codacy.yaml: %w" , err )
@@ -129,7 +129,7 @@ func (c *ConfigType) writeConfig(codacyPath string, config map[string]interface{
129129func (c * ConfigType ) addRuntimeToCodacyYaml (name string , version string ) error {
130130 codacyPath := filepath .Join (c .localCodacyDirectory , "codacy.yaml" )
131131
132- config , err := c .readOrCreateConfig (codacyPath )
132+ config , err := c .loadConfigOrInitializeEmpty (codacyPath )
133133 if err != nil {
134134 return err
135135 }
You can’t perform that action at this time.
0 commit comments