with the implementation of SE-443 we've gained the ability to conditionally promote/demote warnings to errors in a much more granular way than was previously possible[1]. IIUC the long term goal is that all diagnostics that can be produced should eventually belong to a 'diagnostic group' (and possibly multiple of them, given their hierarchical nature) such that they can be more specifically controlled[2]. today, the number of diagnostic groups has increased notably from 0, and, as of writing, we're at ~30ish different groups. however, there are many existing diagnostics that still belong to no group[3].
well... technically it seems this may not actually be the case, at least in the current implementation. it appears that all diagnostics belong to the special group DiagGroupID::no_group. however, that group seemingly cannot actually be used by a client to control the behavior of diagnostics for which that sentinel value is the resolved diagnostic group id. i.e. today, this does not work:
swiftc -warnings-as-errors -Wwarning no_group
// error: unknown warning group: 'no_group' [#UnknownWarningGroup]
this combination of flags seems like it makes sense and could be potentially useful as it would promote to errors only those diagnostics that can be granularly demoted back down if desired. we can achieve something similar today by explicitly enumerating all extant diagnostic groups with -Werror:
swiftc -Werror grp_1 -Werror grp_2 ...
but this seems less convenient as it requires maintaining the list of diagnostic groups (which is expected to change over time), and also leads to a much longer compiler invocation.
however, the current limitations may be artificial, as a naive change to simply comment out this one check appears to enable specifying the no_group value as a diagnostic group id that can control the treatment of these as yet ungrouped warnings.
i'm curious if making a change to allow explicitly passing a diagnostic group id that means 'ungrouped diagnostic' seems like a reasonable and/or possibly useful thing to support to anyone else. i suspect one likely rejoinder would be "why not just add groups for all the currently ungrouped diagnostics?" which, admittedly, would be a better solution, but also... is more work.
p.s. also, if this was discussed in the pitch/review for SE-443 at some point, please point me to it!