hundreds-father-404
03/12/2020, 7:43 PMunions
backend registration hook and I’m wondering which you all prefer?
def rules():
return [UnionRule(Linter, BanditLinter), UnionRule(Linter, BlackFormatter)]
vs.
def unions():
return {Linter: [BanditLinter, BlackFormatter}
@hundreds-breakfast-49010 and I don’t think one is obviously superior.hundreds-father-404
03/12/2020, 7:45 PMunions()
- Less verbosity when registering multiple unions
- Dicts are more ergonomic than UnionRule
Some cons of unions()
- Suggests that you’re overriding the union, when really you are just augmenting it
- Possibly more boilerplate in register.py
when we import each file and now have to call my_file.rules()
and my_file.unions()