CFMT est un outil pour envelopper les commentaires GO sur une certaine longueur à une nouvelle ligne.
go get -u github.com/alexkohler/cfmt
Remarque : CFMT nécessite GOFMT.
Semblable aux autres outils GO static anaylsis (tels que Golint, GO Vet), CFMT peut être invoqué avec un ou plusieurs noms de fichiers, répertoires ou packages nommés par son chemin d'importation. CFMT soutient également le ... jenkcard.
cfmt [flags] files/directories/packages
cfmt imprimera uniquement les modifications qu'elle apportera, mais ne modifiera pas les fichiers d'entrée. cfmt enveloppera une nouvelle ligne ou rejoindra une ligne existante le cas échéant. Voir ce qui suit avant / After de l'exécution cfmt -m=100 :
Avant
// I am a long comment that is over 100 characters long. I should probably wrap to a new line.Après
// I am a long comment that is over 100 characters long. I should probably wrap
// to a new line.Avant
// I am a long comment that is over 100 characters long. I should probably wrap below to the
// rest of the comment.Après
// I am a long comment that is over 100 characters long. I should probably wrap
// below to the rest of the comment.Avant
//I am a long comment that starts without a space and is over 100 characters long. When I wrap, I should still start without a spaceAprès
//I am a long comment that starts without a space and is over 100 characters
//long. When I wrap, I should still start without a space cfmt ignore le bloc ( /* */ ) et les commentaires "groupés" sur une longueur de 10 (c'est-à-dire 10+ lignes consécutives commençant par // ).
Tirez les demandes de bienvenue!
Si vous avez apprécié CFMT, jetez un œil à mes autres outils statiques Anaylsis!