Add command line flag to list all errors and warnings GHC emits
GHC now uses structured datatypes internally to represent error messages. There should be a way to have ghc enumerate all the errors and warnings it can emit. The main consumer of this information will be the error message index (https://errors.haskell.org) in order to check that all emitted error codes are documented, and that the meta-information about which version of ghc first emitted the error is accurate.
Using this flag should look something like this:
> ghc --list-all-errors
GHC-00123 error
GHC-52333 warning
...
The implementation is should hopefully be pretty trivial, and I will implement this feature. Are there any suggestions on how to call this flag?
Additionally it might be useful to emit more information that is available, such as the Warningflag enabling the warning or the Warninggroups containing the warning. I would make this dependent on how readily available this information is in the corresponding data types.
Ping @david-christiansen