@@ -283,8 +283,11 @@ var IsModuleOverride = map[string]bool{
283283 "single_version_override" : true ,
284284}
285285
286+ // RuleLoadLocation contains custom locations for loading rules.
287+ var RuleLoadLocation = map [string ]string {}
288+
286289// OverrideTables allows a user of the build package to override the special-case rules. The user-provided tables replace the built-in tables.
287- func OverrideTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool ) {
290+ func OverrideTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool , ruleLoadLocation map [ string ] string ) {
288291 IsLabelArg = labelArg
289292 LabelDenylist = denylist
290293 IsListArg = listArg
@@ -294,10 +297,11 @@ func OverrideTables(labelArg, denylist, listArg, sortableListArg, sortDenylist,
294297 NamePriority = namePriority
295298 StripLabelLeadingSlashes = stripLabelLeadingSlashes
296299 ShortenAbsoluteLabelsToRelative = shortenAbsoluteLabelsToRelative
300+ RuleLoadLocation = ruleLoadLocation
297301}
298302
299303// 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.
300- func MergeTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool ) {
304+ func MergeTables (labelArg , denylist , listArg , sortableListArg , sortDenylist , sortAllowlist map [string ]bool , namePriority map [string ]int , stripLabelLeadingSlashes , shortenAbsoluteLabelsToRelative bool , ruleLoadLocation map [ string ] string ) {
301305 for k , v := range labelArg {
302306 IsLabelArg [k ] = v
303307 }
@@ -321,4 +325,7 @@ func MergeTables(labelArg, denylist, listArg, sortableListArg, sortDenylist, sor
321325 }
322326 StripLabelLeadingSlashes = stripLabelLeadingSlashes || StripLabelLeadingSlashes
323327 ShortenAbsoluteLabelsToRelative = shortenAbsoluteLabelsToRelative || ShortenAbsoluteLabelsToRelative
328+ for k , v := range ruleLoadLocation {
329+ RuleLoadLocation [k ] = v
330+ }
324331}
0 commit comments