(self)
return True
Save config in the first CONFIG_LOCAL file.
        If no local config file, creates a local .gitguardian.yaml
Save config in the first CONFIG_LOCAL file.
        If no local config file, creates a local .gitguardian.yaml
Save config in the first CONFIG_LOCAL file . If no local config file creates a local . gitguardian . yaml
def save(self) -> bool:
        """
        Save config in the first CONFIG_LOCAL file.
        If no local config file, creates a local .gitguardian.yaml
        """
        config_file = self.DEFAULT_CONFIG_LOCAL
        for filename in self.CONFIG_LOCAL:
            if os.path.isfile(filename):
                config_file = filename
                break

        with open(config_file, "w") as f:
            try:
                stream = yaml.dump(self.to_dict(), indent=2, default_flow_style=False)
                f.write(stream)

            except Exception as e:
                raise click.ClickException(
                    f"Error while saving config in {config_file}:\n{str(e)}"
                )
        return True
def save ( self ) -> bool : config_file = self . DEFAULT_CONFIG_LOCAL for filename in self . CONFIG_LOCAL : if os . path . isfile ( filename ) : config_file = filename break with open ( config_file , "w" ) as f : try : stream = yaml . dump ( self . to_dict ( ) , indent = 2 , default_flow_style = False ) f . write ( stream ) except Exception as e : raise click . ClickException ( f"Error while saving config in {config_file}:\n{str(e)}" ) return True