All Projects → mgechev → dots

mgechev / dots

Licence: MIT license
Implements the wildcard file matching in Go used by golint, go test etc.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to dots

matched
Glob matching with support for multiple patterns and negation. Use `~` in cwd to find files in user home, or `@` for global npm modules.
Stars: ✭ 25 (-3.85%)
Mutual labels:  glob, glob-pattern, wildcard
Micromatch
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Stars: ✭ 1,979 (+7511.54%)
Mutual labels:  glob, glob-pattern, wildcard
deglob
📂 Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.
Stars: ✭ 38 (+46.15%)
Mutual labels:  glob, glob-pattern
faster-than-walk
Faster recursive directory walk on Python 3
Stars: ✭ 36 (+38.46%)
Mutual labels:  glob, glob-pattern
to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Stars: ✭ 16 (-38.46%)
Mutual labels:  glob, glob-pattern
is-valid-glob
Return true if a value is a valid glob pattern string, or array of glob patterns.
Stars: ✭ 21 (-19.23%)
Mutual labels:  glob, glob-pattern
regXwild
⏱ Superfast ^Advanced wildcards++? | Unique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET via Conari (with caching of 0x29 opcodes +optimizations) etc.
Stars: ✭ 20 (-23.08%)
Mutual labels:  glob, wildcard
glob-fs
file globbing for node.js. speedy and powerful alternative to node-glob. This library is experimental and does not work on windows!
Stars: ✭ 54 (+107.69%)
Mutual labels:  glob, glob-pattern
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (+100%)
Mutual labels:  glob, wildcard
glob-object
Filter an object using glob patterns and dot notation.
Stars: ✭ 25 (-3.85%)
Mutual labels:  glob, wildcard
glob-tool
A tool to test globs against sets of test strings quickly and easily for the DigitalOcean Community.
Stars: ✭ 14 (-46.15%)
Mutual labels:  glob, glob-pattern
Glob
A C# Glob library for .NET and .NET Core.
Stars: ✭ 142 (+446.15%)
Mutual labels:  glob
Glob
Glob for C++17
Stars: ✭ 74 (+184.62%)
Mutual labels:  glob
Less Plugin Glob
Globbing support for LESS
Stars: ✭ 70 (+169.23%)
Mutual labels:  glob
Draxt
draxt.js – NodeList/jQuery-like package for File System (node.js)
Stars: ✭ 192 (+638.46%)
Mutual labels:  glob
Fast Glob
🚀 It's a very fast and efficient glob library for Node.js
Stars: ✭ 1,150 (+4323.08%)
Mutual labels:  glob
Is Glob
If you use globs, this will make your code faster. Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. 55+ million downloads.
Stars: ✭ 63 (+142.31%)
Mutual labels:  glob
Run When
Run tasks based on "Git diff" changes 🏃 ➕ ➖
Stars: ✭ 63 (+142.31%)
Mutual labels:  glob
Load Templates
Load templates from file paths, globs or objects, and cache them as normalized objects.
Stars: ✭ 9 (-65.38%)
Mutual labels:  glob
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+10203.85%)
Mutual labels:  glob

Build Status

Dots

Implements the wildcard file matching in Go used by golint, go test etc.

Usage

import "github.com/mgechev/dots"

func main() {
  result, err := dots.Resolve([]string{"./fixtures/..."}, []string{"./fixtures/foo"})
  for _, f := range result {
    fmt.Println(f);
  }
}

If we suppose that we have the following directory structure:

├── README.md
├── fixtures
│   ├── bar
│   │   ├── bar1.go
│   │   └── bar2.go
│   ├── baz
│   │   ├── baz1.go
│   │   ├── baz2.go
│   │   └── baz3.go
│   └── foo
│       ├── foo1.go
│       ├── foo2.go
│       └── foo3.go
└── main.go

The result will be:

fixtures/bar/bar1.go
fixtures/bar/bar2.go
fixtures/baz/baz1.go
fixtures/baz/baz2.go
fixtures/baz/baz3.go

dots supports wildcard in both - the first and the last argument of Resolve, which means that you can ignore files based on a wildcard:

dots.Resolve([]string{"github.com/mgechev/dots"}, []string{"./..."}) // empty list
dots.Resolve([]string{"./fixtures/bar/..."}, []string{"./fixture/foo/...", "./fixtures/baz/..."}) // bar1.go, bar2.go

Preserve package structure

dots allow you to receive a slice of slices where each nested slice represents an individual package:

dots.ResolvePackages([]string{"github.com/mgechev/dots/..."}, []string{})

So we will get the result:

[
  [
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/bar/bar1.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/bar/bar2.go"
  ],
  [
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/baz/baz1.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/baz/baz2.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/baz/baz3.go"
  ],
  [
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/foo/foo1.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/foo/foo2.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/foo/foo3.go"
  ],
  [
    "$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/baz/baz1.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/baz/baz2.go"
  ],
  [
    "$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/foo/foo1.go",
    "$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/foo/foo2.go"
  ],
  [
    "$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/foo/bar/bar1.go"
  ]
]

This method is especially useful, when you want to perform type checking over given package from the result.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].