Reformat comments adhere to gofmt
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Junegunn Choi · committed by Junegunn Choi · parent 4993d19 · Browse files · 7 files·+20 added−45 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+20 added−45 removed
- other:+20 added−45 removed
Provenance
- Commit
f4fd532- Tree
3674d22- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
4993d19
7 files changed+20 added−45 removed
modified:.github/workflows/linux.yml+1 added-1 removed
20 unmodified lines2122232425252627282916 unmodified lines20 unmodified lines
- name: Set up Go uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v2 with: go-version: 1.18 go-version: 1.19
- name: Setup Ruby uses: ruby/setup-ruby@ebaea52cb20fea395b0904125276395e37183dac with:16 unmodified linesmodified:src/ansi_test.go+7 added-7 removed
13 unmodified lines14 // frequently used ANSI sequences. This regex is used as a reference for15 // testing nextAnsiEscapeSequence().16 //17 // References:18-// - https://github.com/gnachman/iTerm219-// - https://web.archive.org/web/20090204053813/http://ascii-table.com/ansi-escape-sequences.php20-// (archived from http://ascii-table.com/ansi-escape-sequences.php)21-// - https://web.archive.org/web/20090227051140/http://ascii-table.com/ansi-escape-sequences-vt-100.php22-// (archived from http://ascii-table.com/ansi-escape-sequences-vt-100.php)23-// - http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html24-// - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html18+// - https://github.com/gnachman/iTerm219+// - https://web.archive.org/web/20090204053813/http://ascii-table.com/ansi-escape-sequences.php20+// (archived from http://ascii-table.com/ansi-escape-sequences.php)21+// - https://web.archive.org/web/20090227051140/http://ascii-table.com/ansi-escape-sequences-vt-100.php22+// (archived from http://ascii-table.com/ansi-escape-sequences-vt-100.php)23+// - http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html24+// - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html25 var ansiRegexReference = regexp.MustCompile("(?:\x1b[\\[()][0-9;]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)")26 27 func testParserReference(t testing.TB, str string) {28 t.Helper()399 unmodified linesmodified:src/ansi.go-1 removed
124 unmodified lines125 // nextAnsiEscapeSequence returns the ANSI escape sequence and is equivalent to126 // calling FindStringIndex() on the below regex (which was originally used):127 //128 // "(?:\x1b[\\[()][0-9;?]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)"129-//129 func nextAnsiEscapeSequence(s string) (int, int) {130 // fast check for ANSI escape sequences131 i := 0132 for ; i < len(s); i++ {276 unmodified linesmodified:src/core.go+1 added-25 removed
1-/*2-Package fzf implements fzf, a command-line fuzzy finder.1+// Package fzf implements fzf, a command-line fuzzy finder.3-4-The MIT License (MIT)5-6-Copyright (c) 2013-2021 Junegunn Choi7-8-Permission is hereby granted, free of charge, to any person obtaining a copy9-of this software and associated documentation files (the "Software"), to deal10-in the Software without restriction, including without limitation the rights11-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell12-copies of the Software, and to permit persons to whom the Software is13-furnished to do so, subject to the following conditions:14-15-The above copyright notice and this permission notice shall be included in16-all copies or substantial portions of the Software.17-18-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR19-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,20-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE21-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER22-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,23-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN24-THE SOFTWARE.25-*/2 package fzf3 4 import (5 "fmt"328 unmodified linesmodified:src/terminal_test.go+3 added-3 removed
419 unmodified lines420 os.Setenv("SHELL", shellBackup)421 }422 423 /*424- Test typical valid placeholders and parsing of them.424+Test typical valid placeholders and parsing of them.425 426- Also since the parser assumes the input is matched with `placeholder` regex,427- the regex is tested here as well.426+Also since the parser assumes the input is matched with `placeholder` regex,427+the regex is tested here as well.428 */429 func TestParsePlaceholder(t *testing.T) {430 // give, want pairs431 templates := map[string]string{207 unmodified linesmodified:src/terminal.go+7 added-7 removed
23 unmodified lines24 25 // import "github.com/pkg/profile"26 27 /*28- Placeholder regex is used to extract placeholders from fzf's template29- strings. Acts as input validation for parsePlaceholder function.30- Describes the syntax, but it is fairly lenient.28+Placeholder regex is used to extract placeholders from fzf's template29+strings. Acts as input validation for parsePlaceholder function.30+Describes the syntax, but it is fairly lenient.31 32- The following pseudo regex has been reverse engineered from the33- implementation. It is overly strict, but better describes whats possible.34- As such it is not useful for validation, but rather to generate test35- cases for example.32+The following pseudo regex has been reverse engineered from the33+implementation. It is overly strict, but better describes whats possible.34+As such it is not useful for validation, but rather to generate test35+cases for example.36 37 \\?(?: # escaped type38 {\+?s?f?RANGE(?:,RANGE)*} # token type39 |{q} # query type2898 unmodified linesmodified:LICENSE+1 added-1 removed
1 The MIT License (MIT)2 3-Copyright (c) 2013-2021 Junegunn Choi3+Copyright (c) 2013-2022 Junegunn Choi4 5 Permission is hereby granted, free of charge, to any person obtaining a copy6 of this software and associated documentation files (the "Software"), to deal7 in the Software without restriction, including without limitation the rights14 unmodified lines