diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/sagikazarmark | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/sagikazarmark')
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/.editorconfig | 21 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/.gitignore | 8 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/.golangci.yaml | 37 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/LICENSE | 19 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/README.md | 37 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/file_type.go | 32 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/finder.go | 171 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/flake.lock | 255 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/flake.nix | 42 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/glob.go | 5 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/glob_windows.go | 8 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/helpers.go | 41 | ||||
| -rw-r--r-- | vendor/github.com/sagikazarmark/locafero/justfile | 14 |
13 files changed, 0 insertions, 690 deletions
diff --git a/vendor/github.com/sagikazarmark/locafero/.editorconfig b/vendor/github.com/sagikazarmark/locafero/.editorconfig deleted file mode 100644 index 6f944f540..000000000 --- a/vendor/github.com/sagikazarmark/locafero/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[{Makefile,*.mk}] -indent_style = tab - -[*.nix] -indent_size = 2 - -[*.go] -indent_style = tab - -[{*.yml,*.yaml}] -indent_size = 2 diff --git a/vendor/github.com/sagikazarmark/locafero/.gitignore b/vendor/github.com/sagikazarmark/locafero/.gitignore deleted file mode 100644 index 8f07e6016..000000000 --- a/vendor/github.com/sagikazarmark/locafero/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/.devenv/ -/.direnv/ -/.task/ -/bin/ -/build/ -/tmp/ -/var/ -/vendor/ diff --git a/vendor/github.com/sagikazarmark/locafero/.golangci.yaml b/vendor/github.com/sagikazarmark/locafero/.golangci.yaml deleted file mode 100644 index a27a42959..000000000 --- a/vendor/github.com/sagikazarmark/locafero/.golangci.yaml +++ /dev/null @@ -1,37 +0,0 @@ -version: "2" - -run: - timeout: 10m - -linters: - enable: - - errcheck - - govet - - ineffassign - - misspell - - nolintlint - - revive - - staticcheck - - unused - - settings: - misspell: - locale: US - nolintlint: - allow-unused: false # report any unused nolint directives - require-specific: false # don't require nolint directives to be specific about which linter is being skipped - -formatters: - enable: - - gci - - gofmt - - gofumpt - - goimports - - golines - - settings: - gci: - sections: - - standard - - default - - localmodule diff --git a/vendor/github.com/sagikazarmark/locafero/LICENSE b/vendor/github.com/sagikazarmark/locafero/LICENSE deleted file mode 100644 index a70b0f296..000000000 --- a/vendor/github.com/sagikazarmark/locafero/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Márk Sági-Kazár <mark.sagikazar@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/sagikazarmark/locafero/README.md b/vendor/github.com/sagikazarmark/locafero/README.md deleted file mode 100644 index d25fe80f3..000000000 --- a/vendor/github.com/sagikazarmark/locafero/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Finder library for [Afero](https://github.com/spf13/afero) - -[](https://github.com/sagikazarmark/locafero/actions/workflows/ci.yaml) -[](https://pkg.go.dev/mod/github.com/sagikazarmark/locafero) - -[](https://deps.dev/go/github.com%252Fsagikazarmark%252Flocafero) - -**Finder library for [Afero](https://github.com/spf13/afero) ported from [go-finder](https://github.com/sagikazarmark/go-finder).** - -> [!WARNING] -> This is an experimental library under development. -> -> **Backwards compatibility is not guaranteed, expect breaking changes.** - -## Installation - -```shell -go get github.com/sagikazarmark/locafero -``` - -## Usage - -Check out the [package example](https://pkg.go.dev/github.com/sagikazarmark/locafero#example-package) on go.dev. - -## Development - -**For an optimal developer experience, it is recommended to install [Nix](https://nixos.org/download.html) and [direnv](https://direnv.net/docs/installation.html).** - -Run the test suite: - -```shell -just test -``` - -## License - -The project is licensed under the [MIT License](LICENSE). diff --git a/vendor/github.com/sagikazarmark/locafero/file_type.go b/vendor/github.com/sagikazarmark/locafero/file_type.go deleted file mode 100644 index 5ea57c93e..000000000 --- a/vendor/github.com/sagikazarmark/locafero/file_type.go +++ /dev/null @@ -1,32 +0,0 @@ -package locafero - -import "io/fs" - -// FileType represents the kind of entries [Finder] can return. -type FileType int - -// FileType represents the kind of entries [Finder] can return. -const ( - FileTypeAny FileType = iota - FileTypeFile - FileTypeDir - - // Deprecated: Use [FileTypeAny] instead. - FileTypeAll = FileTypeAny -) - -func (ft FileType) match(info fs.FileInfo) bool { - switch ft { - case FileTypeAny: - return true - - case FileTypeFile: - return info.Mode().IsRegular() - - case FileTypeDir: - return info.IsDir() - - default: - return false - } -} diff --git a/vendor/github.com/sagikazarmark/locafero/finder.go b/vendor/github.com/sagikazarmark/locafero/finder.go deleted file mode 100644 index ce43c7826..000000000 --- a/vendor/github.com/sagikazarmark/locafero/finder.go +++ /dev/null @@ -1,171 +0,0 @@ -// Package locafero looks for files and directories in an {fs.Fs} filesystem. -package locafero - -import ( - "errors" - "io/fs" - "path/filepath" - "strings" - - "github.com/sourcegraph/conc/pool" - "github.com/spf13/afero" -) - -// Finder looks for files and directories in an [afero.Fs] filesystem. -type Finder struct { - // Paths represents a list of locations that the [Finder] will search in. - // - // They are essentially the root directories or starting points for the search. - // - // Examples: - // - home/user - // - etc - Paths []string - - // Names are specific entries that the [Finder] will look for within the given Paths. - // - // It provides the capability to search for entries with depth, - // meaning it can target deeper locations within the directory structure. - // - // It also supports glob syntax (as defined by [filepath.Match]), offering greater flexibility in search patterns. - // - // Examples: - // - config.yaml - // - home/*/config.yaml - // - home/*/config.* - Names []string - - // Type restricts the kind of entries returned by the [Finder]. - // - // This parameter helps in differentiating and filtering out files from directories or vice versa. - Type FileType -} - -// Find looks for files and directories in an [afero.Fs] filesystem. -func (f Finder) Find(fsys afero.Fs) ([]string, error) { - // Arbitrary go routine limit (TODO: make this a parameter) - p := pool.NewWithResults[[]searchResult]().WithMaxGoroutines(5).WithErrors().WithFirstError() - - for _, searchPath := range f.Paths { - for _, searchName := range f.Names { - p.Go(func() ([]searchResult, error) { - // If the name contains any glob character, perform a glob match - if strings.ContainsAny(searchName, globMatch) { - return globWalkSearch(fsys, searchPath, searchName, f.Type) - } - - return statSearch(fsys, searchPath, searchName, f.Type) - }) - } - } - - searchResults, err := flatten(p.Wait()) - if err != nil { - return nil, err - } - - // Return early if no results were found - if len(searchResults) == 0 { - return nil, nil - } - - results := make([]string, 0, len(searchResults)) - - for _, searchResult := range searchResults { - results = append(results, searchResult.path) - } - - return results, nil -} - -type searchResult struct { - path string - info fs.FileInfo -} - -func flatten[T any](results [][]T, err error) ([]T, error) { - if err != nil { - return nil, err - } - - var flattened []T - - for _, r := range results { - flattened = append(flattened, r...) - } - - return flattened, nil -} - -func globWalkSearch( - fsys afero.Fs, - searchPath string, - searchName string, - searchType FileType, -) ([]searchResult, error) { - var results []searchResult - - err := afero.Walk(fsys, searchPath, func(p string, fileInfo fs.FileInfo, err error) error { - if err != nil { - return err - } - - // Skip the root path - if p == searchPath { - return nil - } - - var result error - - // Stop reading subdirectories - // TODO: add depth detection here - if fileInfo.IsDir() && filepath.Dir(p) == searchPath { - result = fs.SkipDir - } - - // Skip unmatching type - if !searchType.match(fileInfo) { - return result - } - - match, err := filepath.Match(searchName, fileInfo.Name()) - if err != nil { - return err - } - - if match { - results = append(results, searchResult{p, fileInfo}) - } - - return result - }) - if err != nil { - return results, err - } - - return results, nil -} - -func statSearch( - fsys afero.Fs, - searchPath string, - searchName string, - searchType FileType, -) ([]searchResult, error) { - filePath := filepath.Join(searchPath, searchName) - - fileInfo, err := fsys.Stat(filePath) - if errors.Is(err, fs.ErrNotExist) { - return nil, nil - } - if err != nil { - return nil, err - } - - // Skip unmatching type - if !searchType.match(fileInfo) { - return nil, nil - } - - return []searchResult{{filePath, fileInfo}}, nil -} diff --git a/vendor/github.com/sagikazarmark/locafero/flake.lock b/vendor/github.com/sagikazarmark/locafero/flake.lock deleted file mode 100644 index b14a842c2..000000000 --- a/vendor/github.com/sagikazarmark/locafero/flake.lock +++ /dev/null @@ -1,255 +0,0 @@ -{ - "nodes": { - "cachix": { - "inputs": { - "devenv": [ - "devenv" - ], - "flake-compat": [ - "devenv" - ], - "git-hooks": [ - "devenv", - "git-hooks" - ], - "nixpkgs": [ - "devenv", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1748883665, - "narHash": "sha256-R0W7uAg+BLoHjMRMQ8+oiSbTq8nkGz5RDpQ+ZfxxP3A=", - "owner": "cachix", - "repo": "cachix", - "rev": "f707778d902af4d62d8dd92c269f8e70de09acbe", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "latest", - "repo": "cachix", - "type": "github" - } - }, - "devenv": { - "inputs": { - "cachix": "cachix", - "flake-compat": "flake-compat", - "git-hooks": "git-hooks", - "nix": "nix", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1753981111, - "narHash": "sha256-uBJOyMxOkGRmxhD2M5rbN2aV6oP1T2AKq5oBaHHC4mw=", - "owner": "cachix", - "repo": "devenv", - "rev": "d4d70df706b153b601a87ab8e81c88a0b1a373b6", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1747046372, - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "devenv", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1753121425, - "narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "644e0fc48951a860279da645ba77fe4a6e814c5e", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "git-hooks": { - "inputs": { - "flake-compat": [ - "devenv", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "devenv", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1750779888, - "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "devenv", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "nix": { - "inputs": { - "flake-compat": [ - "devenv", - "flake-compat" - ], - "flake-parts": "flake-parts", - "git-hooks-nix": [ - "devenv", - "git-hooks" - ], - "nixpkgs": [ - "devenv", - "nixpkgs" - ], - "nixpkgs-23-11": [ - "devenv" - ], - "nixpkgs-regression": [ - "devenv" - ] - }, - "locked": { - "lastModified": 1752773918, - "narHash": "sha256-dOi/M6yNeuJlj88exI+7k154z+hAhFcuB8tZktiW7rg=", - "owner": "cachix", - "repo": "nix", - "rev": "031c3cf42d2e9391eee373507d8c12e0f9606779", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "devenv-2.30", - "repo": "nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1750441195, - "narHash": "sha256-yke+pm+MdgRb6c0dPt8MgDhv7fcBbdjmv1ZceNTyzKg=", - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "0ceffe312871b443929ff3006960d29b120dc627", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1751159883, - "narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1753939845, - "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "94def634a20494ee057c76998843c015909d6311", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_2" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/vendor/github.com/sagikazarmark/locafero/flake.nix b/vendor/github.com/sagikazarmark/locafero/flake.nix deleted file mode 100644 index bdb10dbe4..000000000 --- a/vendor/github.com/sagikazarmark/locafero/flake.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - devenv.url = "github:cachix/devenv"; - }; - - outputs = - inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ - inputs.devenv.flakeModule - ]; - - systems = [ - "x86_64-linux" - "aarch64-darwin" - ]; - - perSystem = - { pkgs, ... }: - { - devenv.shells = { - default = { - languages = { - go.enable = true; - go.package = pkgs.lib.mkDefault pkgs.go_1_24; - }; - - packages = with pkgs; [ - just - - golangci-lint - ]; - - # https://github.com/cachix/devenv/issues/528#issuecomment-1556108767 - containers = pkgs.lib.mkForce { }; - }; - }; - }; - }; -} diff --git a/vendor/github.com/sagikazarmark/locafero/glob.go b/vendor/github.com/sagikazarmark/locafero/glob.go deleted file mode 100644 index 00f833e99..000000000 --- a/vendor/github.com/sagikazarmark/locafero/glob.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build !windows - -package locafero - -const globMatch = "*?[]\\^" diff --git a/vendor/github.com/sagikazarmark/locafero/glob_windows.go b/vendor/github.com/sagikazarmark/locafero/glob_windows.go deleted file mode 100644 index 7aec2b247..000000000 --- a/vendor/github.com/sagikazarmark/locafero/glob_windows.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build windows - -package locafero - -// See [filepath.Match]: -// -// On Windows, escaping is disabled. Instead, '\\' is treated as path separator. -const globMatch = "*?[]^" diff --git a/vendor/github.com/sagikazarmark/locafero/helpers.go b/vendor/github.com/sagikazarmark/locafero/helpers.go deleted file mode 100644 index 05b434481..000000000 --- a/vendor/github.com/sagikazarmark/locafero/helpers.go +++ /dev/null @@ -1,41 +0,0 @@ -package locafero - -import "fmt" - -// NameWithExtensions creates a list of names from a base name and a list of extensions. -// -// TODO: find a better name for this function. -func NameWithExtensions(baseName string, extensions ...string) []string { - var names []string - - if baseName == "" { - return names - } - - for _, ext := range extensions { - if ext == "" { - continue - } - - names = append(names, fmt.Sprintf("%s.%s", baseName, ext)) - } - - return names -} - -// NameWithOptionalExtensions creates a list of names from a base name and a list of extensions, -// plus it adds the base name (without any extensions) to the end of the list. -// -// TODO: find a better name for this function. -func NameWithOptionalExtensions(baseName string, extensions ...string) []string { - var names []string - - if baseName == "" { - return names - } - - names = NameWithExtensions(baseName, extensions...) - names = append(names, baseName) - - return names -} diff --git a/vendor/github.com/sagikazarmark/locafero/justfile b/vendor/github.com/sagikazarmark/locafero/justfile deleted file mode 100644 index bac5e75db..000000000 --- a/vendor/github.com/sagikazarmark/locafero/justfile +++ /dev/null @@ -1,14 +0,0 @@ -default: - just --list - -test: - go test -count 10 -shuffle on -race -v ./... - -fuzz: - go test -race -v -fuzz=Fuzz -fuzztime=60s ./... - -lint: - golangci-lint run - -fmt: - golangci-lint fmt |
