This patch adds a new flag to lit --xfail-requires-pr which causes lit tests to fail if any XFAIL lines do not also reference a PR. To support this functionality this patch changes how XFAIL lines are parsed to allow one entry in the comma separated list to be a PR (starting with "http://llvm.org/PR").
By default this option is globally disabled in lit. It can be globally enabled by passing the flag, and it can be disabled in a test suite's lit.cfg or lit.site.cfg, using the option config.xFailRequirePR. Additionally extra PR prefixes can be specified globally using the --bug-tracker-prefix flag, or per-test suite by setting config.bugTrackerPrefixes.
Looks like this will have to be rebased -- these have since been migrated to argparse and add_argument in rL283152.
I agree with @ddunbar's suggestion: specifying --bug-tracker-prefix should imply --xfail-requires-pr, which would eliminate the need for this option.
nit-pick: Modern Python's naming convention for variables is snake_case (https://www.python.org/dev/peps/pep-0008/#function-names), which would make this variable name xfail_requires_pr. One nice part about argparse is that foo-bar is automatically converted to an attribute named foo_bar, so we could eliminate the dest= parameter here. Still, I guess there's little value in migrating this codebase from mixedCase to snake_case, whether incrementally or all at once. But I was wondering if maybe @ddunbar has any thoughts here?