I recently edit C # code in vim. And the build system has StyleCop enabled, so everything using the operator should be in alphabetical order.
So, I tried to select below the line of code in visual mode, and then type ": sort".
using System.Security.Permissions;
using System.Runtime.Serialization;
using System.Security;
using System.ServiceModel;
Result:
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Security;
using System.ServiceModel;
It does not pass the StyleCop check because "System.Security" is not ahead of "System.Security.Permissions." ASCII value ";" greater than the ASCII value of ".".
Preferred Result:
using System.Runtime.Serialization;
using System.Security;
using System.Security.Permissions;
using System.ServiceModel;
How to do it?
source
share