The LLVM coding standards say about python code (emphasis mine):
For consistency and to limit churn, code should be automatically formatted with the black utility, which is PEP 8 compliant. Use its default rules. For example, avoid specifying --line-length even though it does not default to 80. The default rules can change between major versions of black. In order to avoid unnecessary churn in the formatting rules, we currently use black version 23.x in LLVM.
The (not particularly new) CVE-2024-21503 (a Regular Expression Denial of Service vulnerability) affects this recommended version of black. I’ve stumbled over this because following LLVM’s policy of requiring this black version triggers a dependabot alert in Github projects that have it enabled.
I’m not sure if this CVE is practically relevant for us and if the potential harm is worth the potential churn with switching to a new black version, but I think it at least warrants a discussion here:
- Under which conditions would we bump the recommended black version?
- Does this CVE (and/or the related dependabot alerts) fall under these conditions?
- If so, should we bump it to the current 26.x version family?
I only found this comment from 2023 about the version bump policy in the RFC that introduced black as recommended formatter:
I think the easiest is that we recommend black 23.x for now and maybe bump that next year if we feel there is a need for it.
@tobiashieta for visibility