@@ -277,8 +277,11 @@ var IsModuleOverride = map[string]bool{
277277 "single_version_override" : true ,
278278}
279279
280+ // RuleLoadLocation contains custom locations for loading rules.
281+ var RuleLoadLocation = map [string ]string {}
282+
280283// OverrideTables allows a user of the build package to override the special-case rules. The user-provided tables replace the built-in tables.
281- func OverrideTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool ) {
284+ func OverrideTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool , ruleLoadLocation map [ string ] string ) {
282285 IsLabelArg = labelArg
283286 LabelDenylist = denylist
284287 IsListArg = listArg
@@ -288,10 +291,11 @@ func OverrideTables(labelArg, denylist, listArg, sortableListArg, sortDenylist,
288291 NamePriority = namePriority
289292 StripLabelLeadingSlashes = stripLabelLeadingSlashes
290293 ShortenAbsoluteLabelsToRelative = shortenAbsoluteLabelsToRelative
294+ RuleLoadLocation = ruleLoadLocation
291295}
292296
293297// MergeTables allows a user of the build package to override the special-case rules. The user-provided tables are merged into the built-in tables.
294- func MergeTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool ) {
298+ func MergeTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool , ruleLoadLocation map [ string ] string ) {
295299 for k , v := range labelArg {
296300 IsLabelArg [k ] = v
297301 }
@@ -315,4 +319,7 @@ func MergeTables(labelArg, denylist, listArg, sortableListArg, sortDenylist, sor
315319 }
316320 StripLabelLeadingSlashes = stripLabelLeadingSlashes || StripLabelLeadingSlashes
317321 ShortenAbsoluteLabelsToRelative = shortenAbsoluteLabelsToRelative || ShortenAbsoluteLabelsToRelative
322+ for k , v := range ruleLoadLocation {
323+ RuleLoadLocation [k ] = v
324+ }
318325}
0 commit comments