File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,7 @@ def load_repo_config
62
62
63
63
# Loads a configuration, ensuring it extends the default configuration.
64
64
def load_file ( file )
65
- config = self . class . load_from_file ( file , default : false , logger : @log )
66
- config = self . class . default_configuration . merge ( config )
67
-
65
+ config = load_file_with_inheritance ( file )
68
66
if @options . fetch ( :verify ) { config . verify_signatures? }
69
67
verify_signatures ( config )
70
68
end
@@ -80,6 +78,12 @@ def load_file(file)
80
78
81
79
private
82
80
81
+ def load_file_with_inheritance ( file )
82
+ config = self . class . load_from_file ( file , default : false , logger : @log )
83
+ base_config = config [ 'inherit_from' ] ? load_file_with_inheritance ( config [ 'inherit_from' ] ) : self . class . default_configuration
84
+ base_config . merge ( config )
85
+ end
86
+
83
87
def verify_signatures ( config )
84
88
if !config . previous_signature?
85
89
raise Overcommit ::Exceptions ::ConfigurationSignatureChanged ,
You can’t perform that action at this time.
0 commit comments