Hello. Prior to this post, I attempted to start this discussion on the gnupg-devel mailing list, however it seems like both of my attempts at sending to those list failed. Hence, I would like to make this into a feature request on the issuer tracker instead.
I'm aware that the issue of following the XDG Base Directory Specification has been brought up multiple times before and turned down consistently, however, I would like to suggest a compromise that doesn't sacrifice the existing ~/.gnupg convention. I'd even be happy to contribute this myself as a patch or a pull request wherever necessary.
In the event that $GNUPGHOME isn't set, and any files such as configs are not present in their usual ~/.gnupg location, let GnuPG also search the relevant XDGBDS paths to see if those files exist there. If they do, load them as normal, but if they don't, continue to prioritise and even create ~/.gnupg to retain backwards compatibility and users' existing expectations. Not too long ago, this approach ended up being taken into consideration by the developer of Bash, which was also historically opposed for many years to adding support for the XDGBDS until this compromise and the prioritisation of legacy paths was brought forward.
The main reason why I ask for this is because it is somewhat annoying having to mix (potentially version-controlled) configuration files in the same directory as private keys and keyring data, which has to be kept secret at all times. Hence, it would be nice for things such as gpg-agent to also search for a config at $XDG_CONFIG_HOME/gnupg/gpg-agent.conf just in case the default ~/.gnupg/gpg-agent.conf or $GNUPGHOME/gpg-agent.conf aren't found.
Kind regards.