File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 135135 default = true ;
136136 } ;
137137
138+ priority = mkOption {
139+ type = types . number ;
140+ description = ''
141+ Defines the priority order in which hooks are executed.
142+ Lower the number, the higher the precedence.
143+ '' ;
144+ default = 0 ;
145+ } ;
146+
138147 fail_fast = mkOption {
139148 type = types . bool ;
140149 description = ''
189198 config = {
190199 raw =
191200 {
192- inherit ( config ) name entry language files types types_or exclude_types pass_filenames fail_fast require_serial stages verbose always_run args ;
201+ inherit ( config ) name entry language files types types_or exclude_types pass_filenames priority fail_fast require_serial stages verbose always_run args ;
193202 id = config . name ;
194203 exclude = mergeExcludes config . excludes ;
195204 } ;
Original file line number Diff line number Diff line change 3030 enabledHooks = filterAttrs ( id : value : value . enable ) cfg . hooks ;
3131 enabledExtraPackages = builtins . concatLists ( mapAttrsToList ( _ : value : value . extraPackages ) enabledHooks ) ;
3232 processedHooks =
33- mapAttrsToList ( id : value : value . raw // { inherit id ; } ) enabledHooks ;
33+ let
34+ # Sort the list of hooks by priority (lower number = higher priority)
35+ sortedHooks = builtins . sort
36+ ( a : b : a . priority < b . priority )
37+ ( mapAttrsToList
38+ ( id : value :
39+ value . raw // {
40+ inherit id ;
41+ priority = value . raw . priority ;
42+ }
43+ )
44+ enabledHooks
45+ ) ;
46+ in
47+ sortedHooks ;
3448
3549 configFile =
3650 performAssertions (
You can’t perform that action at this time.
0 commit comments