Checking sorting of #[cfg(target_os =


#1

For the nix crate we have a lot of platform-specific code sprinkled about and a ton of #[cfg(any(target_os = ..., ...))] sprinkles about. These are easiest to maintain if the OSes are listed alphabetically and I’d like to enforce that during our testing. I don’t see any such checks available from rustc or Clippy, but I’m sure some project has this solved already, though this is rather hard to search GitHub or online for. Does anyone know of any projects doing tests that check this?


#2

This could be a nice thing to add to rustfmt.


#3

I think that’s a perfect place for such functionality. I’ll file an issue for it. Thanks!