@@ -271,8 +271,11 @@ var IsModuleOverride = map[string]bool{
271271 "single_version_override" : true ,
272272}
273273
274+ // RuleLoadLocation contains custom locations for loading rules.
275+ var RuleLoadLocation = map [string ]string {}
276+
274277// OverrideTables allows a user of the build package to override the special-case rules. The user-provided tables replace the built-in tables.
275- func OverrideTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool ) {
278+ func OverrideTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool , ruleLoadLocation map [ string ] string ) {
276279 IsLabelArg = labelArg
277280 LabelDenylist = denylist
278281 IsListArg = listArg
@@ -282,10 +285,11 @@ func OverrideTables(labelArg, denylist, listArg, sortableListArg, sortDenylist,
282285 NamePriority = namePriority
283286 StripLabelLeadingSlashes = stripLabelLeadingSlashes
284287 ShortenAbsoluteLabelsToRelative = shortenAbsoluteLabelsToRelative
288+ RuleLoadLocation = ruleLoadLocation
285289}
286290
287291// 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.
288- func MergeTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool ) {
292+ func MergeTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool , ruleLoadLocation map [ string ] string ) {
289293 for k , v := range labelArg {
290294 IsLabelArg [k ] = v
291295 }
@@ -309,4 +313,7 @@ func MergeTables(labelArg, denylist, listArg, sortableListArg, sortDenylist, sor
309313 }
310314 StripLabelLeadingSlashes = stripLabelLeadingSlashes || StripLabelLeadingSlashes
311315 ShortenAbsoluteLabelsToRelative = shortenAbsoluteLabelsToRelative || ShortenAbsoluteLabelsToRelative
316+ for k , v := range ruleLoadLocation {
317+ RuleLoadLocation [k ] = v
318+ }
312319}
0 commit comments