summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-08-12 22:11:15 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-08-12 22:11:15 +0900
commitf4fd53211a9e3964818c2069aeff5464a679079f (patch)
tree3674d22dd64a6930840db899cf7f6f5a22c816e2
parent4993d19466d5f3ac127de5c0c461cde7ef1894d7 (diff)
Reformat comments adhere to gofmt
-rw-r--r--.github/workflows/linux.yml2
-rw-r--r--LICENSE2
-rw-r--r--src/ansi.go1
-rw-r--r--src/ansi_test.go14
-rw-r--r--src/core.go26
-rw-r--r--src/terminal.go16
-rw-r--r--src/terminal_test.go6
7 files changed, 21 insertions, 46 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index db1acf1e..68a783d4 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -22,7 +22,7 @@ jobs:
- 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
diff --git a/LICENSE b/LICENSE
index 50aa5d92..533a79de 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2013-2021 Junegunn Choi
+Copyright (c) 2013-2022 Junegunn Choi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/ansi.go b/src/ansi.go
index 698bf89e..543dabf3 100644
--- a/src/ansi.go
+++ b/src/ansi.go
@@ -126,7 +126,6 @@ func isCtrlSeqStart(c uint8) bool {
// calling FindStringIndex() on the below regex (which was originally used):
//
// "(?:\x1b[\\[()][0-9;?]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)"
-//
func nextAnsiEscapeSequence(s string) (int, int) {
// fast check for ANSI escape sequences
i := 0
diff --git a/src/ansi_test.go b/src/ansi_test.go
index cdccc10c..781c0a10 100644
--- a/src/ansi_test.go
+++ b/src/ansi_test.go
@@ -15,13 +15,13 @@ import (
// testing nextAnsiEscapeSequence().
//
// References:
-// - https://github.com/gnachman/iTerm2
-// - https://web.archive.org/web/20090204053813/http://ascii-table.com/ansi-escape-sequences.php
-// (archived from http://ascii-table.com/ansi-escape-sequences.php)
-// - https://web.archive.org/web/20090227051140/http://ascii-table.com/ansi-escape-sequences-vt-100.php
-// (archived from http://ascii-table.com/ansi-escape-sequences-vt-100.php)
-// - http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html
-// - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
+// - https://github.com/gnachman/iTerm2
+// - https://web.archive.org/web/20090204053813/http://ascii-table.com/ansi-escape-sequences.php
+// (archived from http://ascii-table.com/ansi-escape-sequences.php)
+// - https://web.archive.org/web/20090227051140/http://ascii-table.com/ansi-escape-sequences-vt-100.php
+// (archived from http://ascii-table.com/ansi-escape-sequences-vt-100.php)
+// - http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html
+// - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
var ansiRegexReference = regexp.MustCompile("(?:\x1b[\\[()][0-9;]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)")
func testParserReference(t testing.TB, str string) {
diff --git a/src/core.go b/src/core.go
index b4bccfbe..ee55f1e3 100644
--- a/src/core.go
+++ b/src/core.go
@@ -1,28 +1,4 @@
-/*
-Package fzf implements fzf, a command-line fuzzy finder.
-
-The MIT License (MIT)
-
-Copyright (c) 2013-2021 Junegunn Choi
-
-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.
-*/
+// Package fzf implements fzf, a command-line fuzzy finder.
package fzf
import (
diff --git a/src/terminal.go b/src/terminal.go
index bce71373..981f13a4 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -25,14 +25,14 @@ import (
// import "github.com/pkg/profile"
/*
- Placeholder regex is used to extract placeholders from fzf's template
- strings. Acts as input validation for parsePlaceholder function.
- Describes the syntax, but it is fairly lenient.
-
- The following pseudo regex has been reverse engineered from the
- implementation. It is overly strict, but better describes whats possible.
- As such it is not useful for validation, but rather to generate test
- cases for example.
+Placeholder regex is used to extract placeholders from fzf's template
+strings. Acts as input validation for parsePlaceholder function.
+Describes the syntax, but it is fairly lenient.
+
+The following pseudo regex has been reverse engineered from the
+implementation. It is overly strict, but better describes whats possible.
+As such it is not useful for validation, but rather to generate test
+cases for example.
\\?(?: # escaped type
{\+?s?f?RANGE(?:,RANGE)*} # token type
diff --git a/src/terminal_test.go b/src/terminal_test.go
index ee19b674..ebb6bda5 100644
--- a/src/terminal_test.go
+++ b/src/terminal_test.go
@@ -421,10 +421,10 @@ func TestPowershellCommands(t *testing.T) {
}
/*
- Test typical valid placeholders and parsing of them.
+Test typical valid placeholders and parsing of them.
- Also since the parser assumes the input is matched with `placeholder` regex,
- the regex is tested here as well.
+Also since the parser assumes the input is matched with `placeholder` regex,
+the regex is tested here as well.
*/
func TestParsePlaceholder(t *testing.T) {
// give, want pairs