Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.5.0 #39

Merged
merged 23 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d8a7f62
Add Go 1.19 to testing targets
andyone Aug 17, 2022
9b067cb
Bump github.com/essentialkaos/check from 1.3.0 to 1.4.0
dependabot[bot] Mar 9, 2023
a852f73
Merge pull request #34 from essentialkaos/dependabot/go_modules/devel…
andyone Mar 9, 2023
6997d68
Bump actions/setup-go from 3 to 4
dependabot[bot] Mar 16, 2023
00680d8
Merge pull request #35 from essentialkaos/dependabot/github_actions/d…
andyone Mar 16, 2023
9e3481b
Improve CI workflow
andyone Jul 14, 2023
0506321
Add typos config
andyone Jul 14, 2023
f935e01
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 5, 2023
2508b27
Merge pull request #36 from essentialkaos/dependabot/github_actions/d…
andyone Sep 5, 2023
41e83e6
Bump actions/setup-go from 4 to 5
dependabot[bot] Dec 7, 2023
646e056
Merge pull request #37 from essentialkaos/dependabot/github_actions/d…
andyone Dec 8, 2023
b4c66b1
Bump github/codeql-action from 2 to 3
dependabot[bot] Dec 14, 2023
914dd01
Merge pull request #38 from essentialkaos/dependabot/github_actions/d…
andyone Dec 14, 2023
423b271
Regenerate Makefile with the latest version of gomakegen
andyone Apr 27, 2024
fd1fc76
Update linenoise to the latest version
andyone Apr 27, 2024
6fb1108
Remove version info
andyone Apr 27, 2024
5bc678b
Merge branch 'develop' of github.com:essentialkaos/go-linenoise into …
andyone Apr 27, 2024
ff098d3
Update CI workflow
andyone Apr 27, 2024
4fa0bac
Improve README
andyone Apr 27, 2024
9f64fe9
Merge branch 'master' into develop
andyone Apr 27, 2024
702c091
Update CI workflow
andyone Apr 27, 2024
fa58b8f
Update CI workflow
andyone Apr 27, 2024
ea2cf65
Update CodeQL workflow
andyone Apr 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 49 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,72 @@ on:
pull_request:
branches: [master]

permissions:
actions: read
contents: read
statuses: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Go:
name: Go
GoLinux:
name: Go (Linux)
runs-on: ubuntu-latest

env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto

strategy:
matrix:
go: [ '1.17.x', '1.18.x' ]
go: [ '1.19.x', '1.20.x', '1.21.x' , '1.22.x' ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go

- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Download dependencies
run: make deps

- name: Run tests
run: make test

GoMac:
name: Go (macOS)
runs-on: macos-latest

needs: GoLinux

strategy:
matrix:
go: [ '1.19.x', '1.20.x', '1.21.x' , '1.22.x' ]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
path: ${{env.SRC_DIR}}
go-version: ${{ matrix.go }}

- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
run: make deps

- name: Run tests
working-directory: ${{env.SRC_DIR}}
run: make test

Typos:
name: Typos
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check spelling
continue-on-error: true
uses: crate-ci/typos@master
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: go
languages: go, c-cpp

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
5 changes: 5 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[files]
extend-exclude = ["go.sum", "*.c", "*.h"]

[default.extend-identifiers]
O_WRONLY = "O_WRONLY"
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################

# This Makefile generated by GoMakeGen 2.1.0 using next command:
# This Makefile generated by GoMakeGen 2.3.2 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen
Expand All @@ -13,6 +13,7 @@ ifdef VERBOSE ## Print verbose information (Flag)
VERBOSE_FLAG = -v
endif

COMPAT ?= 1.18
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)

Expand Down Expand Up @@ -46,7 +47,7 @@ else
endif

ifdef COMPAT ## Compatible Go version (String)
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
else
go mod tidy $(VERBOSE_FLAG)
endif
Expand All @@ -64,13 +65,13 @@ else
go mod tidy $(VERBOSE_FLAG)
endif

test -d vendor && go mod vendor $(VERBOSE_FLAG) || :
test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

mod-download:
go mod download

mod-vendor:
go mod vendor $(VERBOSE_FLAG)
rm -rf vendor && go mod vendor $(VERBOSE_FLAG)

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;
Expand All @@ -81,12 +82,12 @@ vet: ## Runs 'go vet' over sources
help: ## Show this info
@echo -e '\n\033[1mTargets:\033[0m\n'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-14s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-6s\033[0m %s\n", $$1, $$2}'
@echo -e '\n\033[1mVariables:\033[0m\n'
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
| sed 's/ifdef //' \
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-13s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 2.1.0\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 2.3.2\033[0m\n'

################################################################################
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,20 @@
<p align="center">
<a href="https://kaos.sh/g/go-linenoise.v3"><img src="https://gh.kaos.st/godoc.svg" alt="PkgGoDev"></a>
<a href="https://kaos.sh/w/go-linenoise/ci"><img src="https://kaos.sh/w/go-linenoise/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/go-linenoise"><img src="https://kaos.sh/r/go-linenoise.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/l/go-linenoise"><img src="https://kaos.sh/l/ba64cc0e3b72dd3741d5.svg" alt="Code Climate Maintainability" /></a>
<a href="https://kaos.sh/b/go-linenoise"><img src="https://kaos.sh/b/f7800a13-657f-4be9-a359-2845f3433588.svg" alt="Codebeat badge" /></a>
<a href="https://kaos.sh/w/go-linenoise/codeql"><img src="https://kaos.sh/w/go-linenoise/codeql.svg" alt="GitHub Actions CodeQL Status" /></a>
<a href="https://github.com/essentialkaos/go-linenoise/blob/master/LICENSE"><img src="https://gh.kaos.st/bsd.svg"></a>
</p>

<p align="center"><a href="#installation">Installation</a> • <a href="#example">Example</a> • <a href="#build-status">Build Status</a> • <a href="#license">License</a></p>
<p align="center"><a href="#example">Example</a> • <a href="#ci-status">CI Status</a> • <a href="#license">License</a></p>

<br/>

`go-linenoise` is a Go package wrapping the [linenoise](https://github.com/antirez/linenoise) C library. Since `v3` we use [@yhirose](https://github.com/yhirose) [fork](https://github.com/yhirose/linenoise/tree/utf8-support) with UTF-8 support.

This is fork of [go.linenoise](https://github.com/GeertJohan/go.linenoise) package used in [EK](https://github.com/essentialkaos) projects.

### Installation

For install, do:

```
go get github.com/essentialkaos/go-linenoise/v3
```

For update to latest stable release, do:

```
go get -u github.com/essentialkaos/go-linenoise/v3
```

### Example

```go
Expand All @@ -41,7 +27,7 @@ package main
import (
"fmt"

"github.com/essentialkaos/go-linenoise/v3"
linenoise "github.com/essentialkaos/go-linenoise/v3"
)

// ////////////////////////////////////////////////////////////////////////// //
Expand All @@ -59,7 +45,7 @@ func main() {

```

### Build Status
### CI Status

| Branch | Status |
|--------|--------|
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/essentialkaos/go-linenoise/v3

go 1.17

require github.com/essentialkaos/check v1.3.0
require github.com/essentialkaos/check v1.4.0

require (
github.com/kr/pretty v0.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/essentialkaos/check v1.3.0 h1:ria+8o22RCLdt2D/1SHQsEH5Mmy5S+iWHaGHrrbPUc0=
github.com/essentialkaos/check v1.3.0/go.mod h1:PhxzfJWlf5L/skuyhzBLIvjMB5Xu9TIyDIsqpY5MvB8=
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
Expand Down
Loading