A golang formatter that fixes long lines

Overview

Circle CI Go Report Card GoDoc Coverage

golines

Golines is a golang formatter that shortens long lines, in addition to all of the formatting fixes done by gofmt.

Motivation

The standard golang formatting tools (gofmt, goimports, etc.) are great, but deliberately don't shorten long lines; instead, this is an activity left to developers.

While there are different tastes when it comes to line lengths in go, we've generally found that very long lines are more difficult to read than their shortened alternatives. As an example:

myMap := map[string]string{"first key": "first value", "second key": "second value", "third key": "third value", "fourth key": "fourth value", "fifth key": "fifth value"}

vs.

myMap := map[string]string{
	"first key": "first value",
	"second key": "second value",
	"third key": "third value",
	"fourth key": "fourth value",
	"fifth key": "fifth value",
}

We built golines to give go developers the option to automatically shorten long lines, like the one above, according to their preferences.

More background and technical details are available in this blog post.

Examples

See this before and after view of a file with very long lines. More example pairs can be found in the _fixtures directory.

Usage

First, install the tool:

go get -u github.com/segmentio/golines

Then, run:

golines [paths to format]

The paths can be either directories or individual files. If no paths are provided, then input is taken from stdin (as with gofmt).

By default, the results are printed to stdout. To overwrite the existing files in place, use the -w flag.

Options

Some other options are described in the sections below. Run golines --help to see all available flags and settings.

Line length settings

By default, the tool tries to shorten lines that are longer than 100 columns and assumes that 1 tab = 4 columns. The latter can be changed via the -m and -t flags respectively.

Dry-run mode

Running the tool with the --dry-run flag will show pretty, git-style diffs via an embedded Python script.

Comment shortening

Shortening long comment lines is harder than shortening code because comments can have arbitrary structure and format. golines includes some basic logic for shortening single-line (i.e., //-prefixed) comments, but this is turned off by default since the quality isn't great. To enable this feature anyway, run with the --shorten-comments flag.

Custom formatters

By default, the tool will use goimports as the base formatter (if found), otherwise it will revert to gofmt. An explicit formatter can be set via the --base-formatter flag.

Generated files

By default, the tool will not format any files that look like they're generated. If you want to reformat these too, run with the --no-ignore-generated flag.

Struct tag reformatting

In addition to shortening long lines, the tool also aligns struct tag keys; see the associated before and after examples in the _fixtures directory. To turn this behavior off, run with --no-reformat-tags.

Developer Tooling Integration

vim-go

Add the following lines to your vimrc, substituting 128 with your preferred line length:

let g:go_fmt_command = "golines"
let g:go_fmt_options = {
    \ 'golines': '-m 128',
    \ }

Visual Studio Code

  1. Install the Run on Save extension
  2. Go into the VSCode settings menu, scroll down to the section for the "Run on Save" extension, click the "Edit in settings.json" link
  3. Set the emeraldwalk.runonsave key as follows (adding other flags to the golines command as desired):
    "emeraldwalk.runonsave": {
        "commands": [
            {
                "match": "\\.go$",
                "cmd": "golines ${file} -w"
            }
        ]
    }
  1. Save the settings and restart VSCode

Others

Coming soon.

How It Works

For each input source file, golines runs through the following process:

  1. Read the file, break it into lines
  2. Add a specially-formatted annotation (comment) to each line that's longer than the configured maximum
  3. Use Dave Brophy's excellent decorated syntax tree library to parse the code plus added annotations
  4. Do a depth-first traversal of the resulting tree, looking for nodes that have an annotation on them
  5. If a node is part of a line that's too long, shorten it by altering the newlines around the node and/or its children
  6. Repeat steps 2-5 until no more shortening can be done
  7. Run the base formatter (e.g., gofmt) over the results, write these to either stdout or the source file

See this blog post for more technical details.

Limitations

The tool has been tested on a variety of inputs, but it's not perfect. Among other examples, the handling of long lines in comments could be improved. If you see anything particularly egregious, please report via an issue.

Issues
  • Change syscall to os in terminal check for Windows compatibility

    Change syscall to os in terminal check for Windows compatibility

    This is a fix for: https://github.com/segmentio/golines/issues/54 I believe this is the preferred approach to ensure cross-platform compatibility. Things are working for me now in Windows but I don't have a way of verifying things in another OS.

    opened by urbanyeti 10
  • Break down long method chained calls

    Break down long method chained calls

    Best described by an example: rc.Logger.WithField("FIELD", *someField).Info("Some Very Long Info Here")

    could be possibly broken down to: rc.Logger. WithField("FIELD", *someField). Info("Some Very Long Info Here")

    OR

    rc. Logger. WithField("FIELD", *someField). Info("Some Very Long Info Here")

    Formatting is not working, but essentially move the methods chain one per line.

    enhancement 
    opened by nenad-lambdas 8
  • Formatting for very long if statement doesn't work as expected

    Formatting for very long if statement doesn't work as expected

    golines just moved the last part of my if statement to another line, but other statements still on the same line (and it is still extremely long)

    Attaching screenshot that I got using dry-run зображення

    bug 
    opened by Merteg 6
  • Generic type parameters are stripped

    Generic type parameters are stripped

    golines does not yet support generic type parameters.

    Adapting from the example in the official generics tutorial:

    func SumIntsOrFloats[K comparable, V int64 | float64](m map[K]V, longArgument1 int, longArgument2 int, longArgument3 int) V {
    	var s V
    	for _, v := range m {
    		s += v
    	}
    	return s
    }
    

    shortens to:

    func SumIntsOrFloats(
    	m map[K]V,
    	longArgument1 int,
    	longArgument2 int,
    	longArgument3 int,
    ) V {
    	var s V
    	for _, v := range m {
    		s += v
    	}
    	return s
    }
    

    which is missing the bracketed type parameters and thus is incorrect.

    We depend on https://github.com/dave/dst to generate the ASTs that are used in the shortening process, but unfortunately that library won't be fixed to support generics for a while because the author is currently off-the-grid (see https://github.com/dave/dst/issues/63 for details). I'll follow that issue, and when it's fixed we should be able to fix golines as well.

    Apologies for any inconvenience caused here.

    bug 
    opened by yolken 5
  • Generic type parameters stripped, if file includes struct tags with more than one key

    Generic type parameters stripped, if file includes struct tags with more than one key

    If the file includes any struct tags possibly needing alignment (meaning there are at least 2 tags on a field), generic parameters from a function later in the file are stripped.

    I have confirmed this is not an issue in the backend formatter with both gofmt and goimports.

    Example

    Passing

    package strips_generics
    
    type needsTagAllignemnt struct {
            Foo  *bool   `json:"foo" db:"foo"`
    }
    
    
    // Has its type parameters stripped
    func setDefault[T any](dst **T, val T) {
            if *dst == nil {
                    *dst = &val
            }
    }
    

    into golines with golines ./main.go outputs

    package strips_generics
    
    type needsTagAllignemnt struct {
            Foo *bool `json:"foo" db:"foo"`
    }
    
    // Has its type parameters stripped
    func setDefault(dst **T, val T) {
            if *dst == nil {
                    *dst = &val
            }
    }
    
    

    Code with accompanying go.mod: test.zip

    bug 
    opened by bakape 4
  • Specifying base-formatter causes golines to not shorten anything

    Specifying base-formatter causes golines to not shorten anything

    Running this with latest golines:

    golines --base-formatter "cat test.go" -m 120 test.go
    

    Where test.go contains:

    package main
    
    import "fmt"
    
    func MyLongFunction(one, two, three, four, five, six, seven, eight, nine, ten, eleven string) {
    	fmt.Println("Hello world!")
    }
    
    $ golines --base-formatter "cat test.go" -m 50 test.go 
    package main
    
    import "fmt"
    
    func MyLongFunction(one, two, three, four, five, six, seven, eight, nine, ten, eleven string) {
            fmt.Println("Hello world!")
    }
    $ golines -m 50 test.go 
    package main
    
    import "fmt"
    
    func MyLongFunction(
            one, two, three, four, five, six, seven, eight, nine, ten, eleven string,
    ) {
            fmt.Println("Hello world!")
    }
    

    Naturally one would specify an actually useful base-formatter, but this is just to make the case.

    documentation 
    opened by fgblomqvist 4
  • Fix formatting for very long binary expressions

    Fix formatting for very long binary expressions

    Issue

    I found a problem that if we have a long and complex expression, then golines will add a new line only before last operand. So if you have a code like this:

    if getBooool1() || getBooool2() || getBooool3() || getBooool4() || getBooool5() || getBooool6() || getBooool7() {
    	return "Hey"
    }
    

    it will become

    if getBooool1() || getBooool2() || getBooool3() || getBooool4() || getBooool5() || getBooool6() ||
            getBooool7() {
    	return "Hey"
    }
    

    Solution

    My fix is pretty simple. The result will look like this

    if getBooool1() || getBooool2() || getBooool3() || getBooool4() || getBooool5() ||
            getBooool6() ||
            getBooool7() {
    	return "Hey"
    }
    

    It is not perfect. I would like to see something like this:

    if getBooool1() || getBooool2() || getBooool3() || getBooool4() || getBooool5() ||
            getBooool6() || getBooool7() {
    	return "Hey"
    }
    

    but this will require much more changes and really big refactoring I think. It is because how complex BinaryExpr are treated by dst

    opened by Merteg 4
  • Multiple tags with one containing `:`s

    Multiple tags with one containing `:`s

    The below code works as expected:

    package pkg
    
    type MyStruct struct {
    	Field1 string `url:"http://username:[email protected]:1234"`
    }
    

    No changes:

    golines --dry-run ./pkg/foo.go
    // No output
    

    The code below does NOT work as expected if I add another tag in front of or behind the url tag:

    package pkg
    
    type MyStruct struct {
    	Field1 string `param:"FOOBAR" url:"http://username:[email protected]:1234"`
    }
    
    $ golines --dry-run ./pkg/foo.go
    
    --- ./pkg/foo.go
    +++ ./pkg/foo.go.shortened
    @@ -1,6 +1,6 @@
     package pkg
     type MyStruct struct {
    -	Field1 string `param:"FOOBAR" url:"http://username:[email protected]:1234"`
    +	Field1 string `param:"FOOBAR" url:"http://username:[email protected]:1234" http:"" username:"" bar:""`
     }
    

    Also if the command above does align the tags, what does adding --reformat-tags do?

    bug 
    opened by akarl 4
  • Indent tag declaration beginnings of embedded structs

    Indent tag declaration beginnings of embedded structs

    Here is an example: MyStruct2's tags are not aligned with other fields of MyStruct. It will be nice if tag declaration beginnings were aligned too.

    package fixtures
    
    type MyStruct struct {
    	Field1    string `json:"field3" tag:"something"`
    	Field2    string `              tag:"something else"`
    	MyStruct2 `json:"ms2"    tag:"tada"`
    }
    
    type MyStruct2 struct {
    	Field3 string `json:"field3"`
    }
    
    enhancement 
    opened by f-person 4
  • Error installing v0.10.0

    Error installing v0.10.0

    Seems like the github.com/dave/[email protected] module isn't compiling properly. Strangely, I only see this error in Github Actions, but not on my Mac. I'm wondering if it's a Linux issue?

    Update: I cannot reproduce in a Docker container on my Mac, so probably not a Linux issue. Am I doing something stupid?

    $ go install github.com/segmentio/[email protected]
    go: downloading github.com/segmentio/golines v0.10.0
    go: downloading github.com/dave/dst v0.27.0
    go: downloading github.com/fatih/structtag v1.2.0
    go: downloading github.com/pmezard/go-difflib v1.0.0
    go: downloading github.com/sirupsen/logrus v1.4.2
    go: downloading github.com/x-cray/logrus-prefixed-formatter v0.5.2
    go: downloading golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167
    go: downloading gopkg.in/alecthomas/kingpin.v2 v2.2.6
    go: downloading golang.org/x/tools v0.1.10
    go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
    go: downloading golang.org/x/sys v0.0.0-20220318055525-2edf467146b5
    go: downloading github.com/alecthomas/template v0.0.0-201907180[12](https://github.com/weberc2/mono/runs/6804449321?check_suite_focus=true#step:5:13)654-fb15b899a751
    go: downloading github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
    go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
    go: downloading github.com/mattn/go-colorable v0.1.4
    go: downloading github.com/mattn/go-isatty v0.0.10
    go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
    go: downloading golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
    # github.com/dave/dst/decorator
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:620:12: n.Type.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:621:29: n.Type.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:625:12: n.Type.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:692:7: n.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:693:24: n.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:697:7: n.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:9[13](https://github.com/weberc2/mono/runs/6804449321?check_suite_focus=true#step:5:14):8: undefined: ast.IndexListExpr
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:[14](https://github.com/weberc2/mono/runs/6804449321?check_suite_focus=true#step:5:15)40:7: n.TypeParams undefined (type *ast.TypeSpec has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:1441:24: n.TypeParams undefined (type *ast.TypeSpec has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:1445:7: n.TypeParams undefined (type *ast.TypeSpec has no field or method TypeParams)
    Error: /go/pkg/mod/github.com/dave/[email protected]/decorator/decorator-fragment-generated.go:1445:7: too many errors
    note: module requires Go 1.[18](https://github.com/weberc2/mono/runs/6804449321?check_suite_focus=true#step:5:19)
    Error: Process completed with exit code 2.
    
    documentation 
    opened by weberc2 3
  • VS Code integration no longer working

    VS Code integration no longer working

    I may be doing something wrong, but again same thing with gofumpt: https://github.com/mvdan/gofumpt/issues/83

    I opened https://github.com/golang/go/issues/42015 but if someone more knowledgeable could confirm or perhaps provide details it would be appreciated.

    documentation 
    opened by rendaw 3
  • Unwrap lines when wrapping isn't needed

    Unwrap lines when wrapping isn't needed

    Hi, thanks for golines, it's a fantastic tool! I'm just wondering if there are any plans to add "unwraps" for lines that are wrapped but don't need to be?

    As a real world example, if I write this:

    return nil, fmt.Errorf("cannot get frontmatter from Markdown file `%s`: %w", path, err)
    

    And running golines formats it to this:

    return nil, fmt.Errorf(
      "cannot get frontmatter from Markdown file `%s`: %w",
      path,
      err,
    )
    

    But then let's say I simplify the error message. Current behavior would be to leave the line breaks in place:

    return nil, fmt.Errorf(
      "cannot get frontmatter: %w",
      err,
    )
    

    But what I would want is this:

    return nil, fmt.Errorf("can't get frontmatter: %w", err)
    

    Thanks for considering!

    enhancement 
    opened by glacials 0
  • Any plans on adding a --lint flag

    Any plans on adding a --lint flag

    Hi, first of all, thank you so much for the hard work and this tool. Recently at work, I have been trying to standardise our way of using golangci-lint and I have seen that there is a lll linter but I was not really happy with it as it just cares about long lines does not take a lot of things into consideration as golines does which is why I prefer golines.

    My question is if there is any plan to maybe add something like a --lint flag so that golines only shows the errors for the lines that need to be changed, etc? I guess this is somewhere between the --list-files and --dry-run but without showing all the changes I think.

    I would like to know your thoughts, and if something like this could be achieved. If so, although not a golang guru myself I would love to try and help to achieve this maybe you'd need to let me know your thoughts and where I could begin. I remember seeing a conversation about golines and someone asking to add it to golangci-lint here https://github.com/golangci/golangci-lint/issues/1914 , so maybe adding a --lint flag would probably help.

    enhancement 
    opened by vitorf7 0
  • Do not shorten output comments that are in Godoc examples

    Do not shorten output comments that are in Godoc examples

    An example of a example_test.go file that golines --shorten-comments --base-formatter=gofumpt -w . currently breaks is: https://go.dev/play/p/zjwVoZGcobT

    As with typical tests, examples are functions that reside in a package’s _test.go files. Unlike normal test functions, though, example functions take no arguments and begin with the word Example instead of Test. If a comment begins with // Output: then it and any commented lines immediately following it should not be shortened by --shorten-comments.

    At least, I think there's no valid way to shorten output lines!

    enhancement 
    opened by StevenACoffman 0
  • Formatting body of case in switch statement does not work

    Formatting body of case in switch statement does not work

    Long lines within the body of a case statement are not wrapped like they would be if the same statement was not contained within the body of a case statement.

    switch int {
      case 1:
        logger.Log.LogMessage("this is a long string log message, and there are a few more params to this function, and as a line I am far longer than 100 columns", "Information", "1234-5678-9111-1234")
    }
    

    run golines on a file with the logger.Log.Logmessage() function in the case body, and then outside, and you will see within the case body, the line is not chopped/wrapped.

    bug good first issue 
    opened by rcurran1221 0
  • Reflow long comment lines which don't end with a period

    Reflow long comment lines which don't end with a period

    $ cat x.go
    package main
    
    // Unlike the above comment block, only the current line in this comment block has length greater than the
    // target maximum line length
    // but since the previous line doesn't end with a period, it should be reflown with this line
    // despite both the lines being shorter than the target maximum line length.
    
    $ golines --shorten-comments x.go
    package main
    
    // Unlike the above comment block, only the current line in this comment block has length greater
    // than the
    // target maximum line length
    // but since the previous line doesn't end with a period, it should be reflown with this line
    // despite both the lines being shorter than the target maximum line length.
    

    The modified behavior is to reflow long comment lines which don't end with a period with the consecutive comment lines, irrespective of the latter being long or not.

    $ golines --shorten-comments x.go
    package main
    
    // Unlike the above comment block, only the current line in this comment block has length greater
    // than the target maximum line length but since the previous line doesn't end with a period, it
    // should be reflown with this line despite both the lines being shorter than the target maximum
    // line length.
    
    opened by shivansh 1
  • packing function call lines

    packing function call lines

    Thank you for this great library!

    I have a request for an option to wrap long function calls. I like the current way of handling chaining method calls. But it seems if one function call gets too long for a given, length then it will stack all the arguments with each getting its own new line. I would like to pack as many argument into one line before wrapping to the next line instead of stacking. I have code that does a lot of error handling and I am finding that lots of my vertical screen real estate is getting taken up by error handling by argument stacking.

    So instead of this:

    		impl.stats.FuncError(
    			example,
    			with9999999,
    			"argument",
    			stacking101010101010,
    			isThereAnywayToPackThemOnOneLine(err),
                            helloWorld,
    		)
    

    I want to do this:

    		impl.stats.FuncError(example, with9999999, "argument", stacking101010101010,
    			isThereAnywayToPackThemOnOneLine(err), helloWorld
    		)
    

    I like how you stack map values. I'm using v0.6.0.

    enhancement 
    opened by timmyimprint 1
Releases(v0.10.0)
Owner
Segment
Segment
Find outdated golang packages

This project is not supported anymore Go-outdated is minimalistic library that helps to find outdated packages hosted on github.com in your golang pro

null 44 Nov 1, 2021
Golang AST visualizer

GoAst Viewer Golang AST visualizer. Demo GoAst Viewer Demo Usage You just need to run a http server and open your browser to index.html Installation T

Tomohito Ozaki 623 Jun 22, 2022
PlantUML Class Diagram Generator for golang projects

GoPlantUML PlantUML Class Diagram Generator for golang projects. Generates class diagram text compatible with plantuml with the information of all str

Javier Feliu 984 Jun 27, 2022
A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

360 Enterprise Security Group, Endpoint Security, inc. 3k Jun 26, 2022
Know when GC runs from inside your golang code

gcnotifier gcnotifier provides a way to receive notifications after every run of the garbage collector (GC). Knowing when GC runs is useful to instruc

Carlo Alberto Ferraris 168 Jun 10, 2022
a simple golang SSA viewer tool use for code analysis or make a linter

ssaviewer A simple golang SSA viewer tool use for code analysis or make a linter ssa.html generate code modify from src/cmd/compile/internal/ssa/html.

null 7 May 17, 2022
The Golang linter that checks that there is no simultaneous return of `nil` error and an invalid value.

nilnil Checks that there is no simultaneous return of nil error and an invalid value. Installation & usage $ go install github.com/Antonboom/[email protected]

Anton Telyshev 10 Jun 23, 2022
API em Golang utilizando clean architecture

Clean Arch in Go Read about Clean Architecture Build make Run tests make te

Marcos 1 Dec 23, 2021
golang long polling library. Makes web pub-sub easy via HTTP long-poll server :smiley: :coffee: :computer:

golongpoll Golang long polling library. Makes web pub-sub easy via an HTTP long-poll server. New in v1.1 Deprecated CreateManager and CreateCustomMana

J Cuga 600 Jun 23, 2022
eac3to wrapper that fixes its bug 288

eac3to-wrapper eac3to-wrapper aims to fix eac3to's long standing bug 288. To build, first install Go from golang.org/dl, then: go build -ldflags "-X m

null 4 Jun 7, 2022
Quick and simple Go application that fixes updates on non TPM, UEFI devices on the latest insider builds.

W11-Updater Quick and simple Go application that fixes updates on non TPM, UEFI devices on the latest insider builds. Sick of this bullshit? Build Ins

cryptofyre 6 Oct 21, 2021
Console JSON formatter with query feature

Console JSON formatter with query feature. Install: $ go get github.com/miolini/jsonf Usage: Usage of jsonf: -c=true: colorize output -d=false: de

Artem Andreenko 63 Jan 23, 2022
A shell parser, formatter, and interpreter with bash support; includes shfmt

sh A shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. Requires Go 1.14 or later. Quick start To parse shell scripts, in

Daniel Martí 4.9k Jun 26, 2022
A shell parser, formatter, and interpreter with bash support; includes shfmt

sh A shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. Requires Go 1.14 or later. Quick start To parse shell scripts, in

Daniel Martí 4.9k Jun 26, 2022
Small Clojure interpreter, linter and formatter.

Joker is a small Clojure interpreter, linter and formatter written in Go. Installation On macOS, the easiest way to install Joker is via Homebrew: bre

Roman Bataev 1.4k Jun 22, 2022
go-playground-converter is formatter error response inspiration like express-validator in nodejs build on top go-playground-validator.

Go Playground Converter go-playground-converter is formatter error response inspiration like express-validator in nodejs build on top in go-playground

Restu Wahyu Saputra 7 Jun 23, 2022
groqfmt is a formatter for the GROQ query language

groqfmt groqfmt is a formatter for the GROQ query language. Usage Either: groqfmt INPUT > OUTPUT or: cat INPUT | groqfmt > OUTPUT or cat INPUT | groqf

Sanity 7 May 20, 2022
tabitha is a no-frills tabular formatter for the terminal.

tabitha tabitha is a no-frills tabular formatter for the terminal. Features Supports padding output to the longest display text, honoring ANSI colors

Jim Schubert 0 Oct 21, 2021
axmlfmt is an opinionated formatter for Android XML resources

axmlfmt axmlfmt is an opinionated formatter for Android XML resources. It takes XML that looks like <?xml version="1.0" encoding="utf-8"?> <LinearLayo

Rashad Sookram 2 May 14, 2022
Opionated sql formatter for use with .go files containing backticked queries

fumpt-the-sql Opionated sql formatter for use with .go files containing backticked queries. Uses https://sqlformat.darold.net/ for the actual sql form

Geoff Cowan 1 Dec 10, 2021
Esfmt - An opinionated, zero-configuration formatter for ES/TS/ESX/TSX

esfmt - an opinionated, zero-configuration formatter for ES/TS/ESX/TSX Status: t

Alec Thomas 5 Apr 5, 2022
Mdfmt - A Markdown formatter that follow the CommonMark. Like gofmt, but for Markdown

Introduction A Markdown formatter that follow the CommonMark. Like gofmt, but fo

杨英明 13 Jun 6, 2022
JOB, make your short-term command as a long-term job. 将命令行规划成任务的工具

job make your short-term command as a long-term job Install Shell Install (Linux & MacOS) # binary will be $(go env GOPATH)/bin/job $: curl -sfL https

JayL 115 Jun 24, 2022
A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Robert K 210 May 4, 2022
A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Robert K 210 May 4, 2022
Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Cadence Visit cadenceworkflow.io to learn about Cadence. This repo contains the source code of the Cadence server. To implement workflows, activities

Uber Open Source 6.1k Jun 29, 2022
Continuous profiling for long-term postmortem analysis

profefe, a continuous profiling system, collects profiling data from a fleet of running applications and provides API for querying profiling samples for postmortem performance analysis.

profefe - continuous profiling 531 Jun 30, 2022
Orchestra is a library to manage long running go processes.

Orchestra Orchestra is a library to manage long running go processes. At the heart of the library is an interface called Player // Player is a long ru

Stephen Afam-Osemene 105 May 2, 2022
👄 The most accurate natural language detection library in the Go ecosystem, suitable for long and short text alike

?? The most accurate natural language detection library in the Go ecosystem, suitable for long and short text alike

Peter M. Stahl 678 Jun 22, 2022