CFMT ist ein Werkzeug, um Go -Kommentare über eine bestimmte Länge in eine neue Zeile zu wickeln.
go get -u github.com/alexkohler/cfmt
HINWEIS : CFMT benötigt GOFMT.
Ähnlich wie bei anderen Go -statischen Anaylsis -Tools (wie Golint, Go -Tierarzt) kann CFMT mit einem oder mehreren Dateinamen, Verzeichnissen oder Paketen aufgerufen werden, die von seinem Importpfad benannt sind. CFMT unterstützt auch die ... Wildcard.
cfmt [flags] files/directories/packages
cfmt nur die Änderungen, die sie vornehmen werden, die Eingabedateien jedoch nicht. cfmt wird in eine neue Linie einwickeln oder gegebenenfalls eine vorhandene Linie verbinden. Siehe Folgendes vor/Afters des Ausführens von cfmt -m=100 :
Vor
// I am a long comment that is over 100 characters long. I should probably wrap to a new line.Nach
// I am a long comment that is over 100 characters long. I should probably wrap
// to a new line.Vor
// I am a long comment that is over 100 characters long. I should probably wrap below to the
// rest of the comment.Nach
// I am a long comment that is over 100 characters long. I should probably wrap
// below to the rest of the comment.Vor
//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 spaceNach
//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 ignoriert Block ( /* */ ) Kommentare und "gruppierte" Kommentare über eine Länge von 10 (dh 10+ aufeinanderfolgende Zeilen beginnend mit // ).
Anfragen willkommen!
Wenn Sie CFMT genossen haben, schauen Sie sich meine anderen statischen Anaylsis -Tools an!