e7da059
@@ -158,7 +158,7 @@
if checks == []:
continue
print("Group: " + group)
- for c in sorted(checks):
+ for c in sorted(checks, key=lambda c: int(c.sort_key)):
print(" {}: {}".format(c.name, c.text))
print()
Previously, errors such as
TypeError: '<' not supported between instances of 'RCheckCheckMacro' and 'RCheckBuildRequires'
would result from trying to sort the check classes directly, which don't implement the __lt__ method for sorting.
__lt__
This fix uses the sort_key attribute inherited from AbstractCheck to sort the checks.
sort_key
AbstractCheck
@mkrupcale Could you please rebase on current master? I can't merge until you do.
rebased onto e7da059
@ngompa Done. Is this always required even without merge conflicts?
I'm not sure. I think if Pagure itself can do the rebase without issue, it'll just do it (fast-forward merge).
Pull-Request has been merged by ngompa
Previously, errors such as
TypeError: '<' not supported between instances of 'RCheckCheckMacro' and 'RCheckBuildRequires'
would result from trying to sort the check classes directly, which don't implement the
__lt__
method for sorting.This fix uses the
sort_key
attribute inherited fromAbstractCheck
to sort the checks.sort_key
attribute for sorting checks