Help us shape the future of Go! Take the 2026 Go Developer Survey

types

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]Command{

	"python": {
		Executable: "python",
		Switches:   []string{"-m", "ast", "-a"},
		Options:    "",
	},
	"ruby": {
		Executable: "ruby",
		Switches:   []string{"--dump=parsetree"},
		Options:    "",
	},
	"sql": {
		Executable: "sqlformat",
		Switches: []string{
			"--reindent_aligned",
			"--identifiers=lower",
			"--strip-comments",
			"--keywords=upper",
		},
		Options: "",
	},
	"javascript": {
		Executable: "node",
		Switches:   []string{"-e", JsSwitches},
		Options:    `{sourceType: "module", ecmaVersion: "latest"}`,
	},

	"json": {
		Executable: "jsonformat",
		Switches:   []string{},
		Options:    "",
	},

	"go": {
		Executable: "gotree",
		Switches:   []string{},
		Options:    "",
	},
}
View Source
var JsSwitches string = `` /* 218-byte string literal not displayed */

Functions

This section is empty.

Types

type Command

type Command struct {
	Executable string   `toml:"executable"`
	Switches   []string `toml:"switches"`
	Options    string   `toml:"options"`
}

Structs to hold options and configurations

type Config

type Config struct {
	Description string             `toml:"description"`
	Commands    map[string]Command `toml:"commands"`
	Glob        string             `toml:"glob"`
}

Structs to hold options and configurations

type Highlights

type Highlights struct {
	Add     string
	Del     string
	Header  string
	Info    string
	Clear   string
	Neutral string
}

Structs to hold options and configurations

var Colors Highlights = Highlights{
	Add:     "\x1b[32m",
	Del:     "\x1b[31m",
	Header:  "\x1b[33m",
	Info:    "\x1b[36m",
	Clear:   "\x1b[0m",
	Neutral: "",
}

In places, github.com/fatih/color is used, but raw ANSI is easier for writing custom reports based on sergi/go-diff/diffmatchpatch

var Dumbterm Highlights = Highlights{
	Add:     "{{+",
	Del:     "{{-",
	Header:  "",
	Info:    "",
	Clear:   "}}",
	Neutral: "{{_",
}
var PlainASCII Highlights = Highlights{
	Add:     "",
	Del:     "",
	Header:  "",
	Info:    "",
	Clear:   "",
	Neutral: "",
}

type LineType

type LineType int8
const (
	Status      LineType = iota
	CompactDiff          // Probably deprecated for "fake" RawNames
	RawNames
)

type Options

type Options struct {
	Status      bool
	Semantic    bool
	Parsetree   bool
	Glob        string
	Minimal     bool
	Dumbterm    bool
	Verbose     bool
	Source      string
	Destination string
}

Structs to hold options and configurations

type ParseType

type ParseType uint8

Create "enum" of filetypes we can handle (<=256 langs for now)

const (
	Ruby ParseType = iota
	Python
	JavaScript
	JSON
	Go
	Treesit
	SomeOtherLanguage
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL