Skip to content

Commit 60dd882

Browse files
committed
feat: update repo and dependencies (#1)
Release new forked version with no security issue
1 parent df97e07 commit 60dd882

File tree

18 files changed

+949
-588
lines changed

18 files changed

+949
-588
lines changed

.github/workflows/go.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Go
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "images/**"
7+
- "**/*.md"
8+
branches:
9+
- main
10+
push:
11+
paths-ignore:
12+
- "images/**"
13+
- "**/*.md"
14+
branches:
15+
- main
16+
17+
jobs:
18+
lint:
19+
name: Run linting
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/setup-go@v3
23+
with:
24+
go-version: 1.19.x
25+
- uses: actions/checkout@v3
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v3
28+
with:
29+
version: "latest"
30+
args: -c ./golangci.yml
31+
- name: Format lint
32+
run: |
33+
make install-tools && make format && git diff --quiet
34+
test:
35+
name: Run tests
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
go:
40+
[
41+
"1.16.x",
42+
"1.17.x",
43+
"1.18.x",
44+
"1.19.x",
45+
]
46+
steps:
47+
- uses: actions/checkout@v3
48+
- name: Setup go
49+
uses: actions/setup-go@v3
50+
with:
51+
go-version: ${{matrix.go}}
52+
- name: Run Tests
53+
run: make test

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Makefile

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,23 @@
1-
.PHONY: all clean clean-coverage install install-dependencies install-tools lint test test-verbose test-with-coverage
1+
.PHONY: install-tools lint test test-verbose format benchmark
22

3-
export ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
4-
export PKG := github.com/sergi/go-diff
5-
export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
6-
7-
$(eval $(ARGS):;@:) # turn arguments into do-nothing targets
8-
export ARGS
9-
10-
ifdef ARGS
11-
PKG_TEST := $(ARGS)
12-
else
13-
PKG_TEST := $(PKG)/...
14-
endif
15-
16-
all: install-tools install-dependencies install lint test
17-
18-
clean:
19-
go clean -i $(PKG)/...
20-
go clean -i -race $(PKG)/...
21-
clean-coverage:
22-
find $(ROOT_DIR) | grep .coverprofile | xargs rm
23-
install:
24-
go install -v $(PKG)/...
25-
install-dependencies:
26-
go get -t -v $(PKG)/...
27-
go build -v $(PKG)/...
283
install-tools:
294
# Install linting tools
30-
go get -u -v golang.org/x/lint/...
31-
go get -u -v github.com/kisielk/errcheck/...
5+
go install github.com/golangci/golangci-lint/cmd/[email protected]
6+
go install mvdan.cc/gofumpt@latest
7+
go install github.com/segmentio/golines@latest
328

33-
# Install code coverage tools
34-
go get -u -v github.com/onsi/ginkgo/ginkgo/...
35-
go get -u -v github.com/modocache/gover/...
36-
go get -u -v github.com/mattn/goveralls/...
379
lint:
38-
$(ROOT_DIR)/scripts/lint.sh
10+
golangci-lint run -c ./golangci.yml ./...
11+
12+
format:
13+
gofumpt -l -w -extra .
14+
golines . -w
15+
3916
test:
40-
go test -race -test.timeout 120s $(PKG_TEST)
17+
go test -race -test.timeout 120s -count=1 ./...
18+
4119
test-verbose:
42-
go test -race -test.timeout 120s -v $(PKG_TEST)
43-
test-with-coverage:
44-
ginkgo -r -cover -race -skipPackage="testdata"
20+
go test -race -test.timeout 120s -v -cover -count=1 ./...
21+
22+
benchmark:
23+
go test -bench=. -benchmem ./...

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# go-diff [![GoDoc](https://godoc.org/github.com/sergi/go-diff?status.png)](https://godoc.org/github.com/sergi/go-diff/diffmatchpatch) [![Build Status](https://travis-ci.org/sergi/go-diff.svg?branch=master)](https://travis-ci.org/sergi/go-diff) [![Coverage Status](https://coveralls.io/repos/sergi/go-diff/badge.png?branch=master)](https://coveralls.io/r/sergi/go-diff?branch=master)
1+
# go-diff [![GoDoc](https://godoc.org/github.com/gkampitakis/go-diff?status.png)](https://godoc.org/github.com/gkampitakis/go-diff/diffmatchpatch)
22

33
go-diff offers algorithms to perform operations required for synchronizing plain text:
44

@@ -9,7 +9,7 @@ go-diff offers algorithms to perform operations required for synchronizing plain
99
## Installation
1010

1111
```bash
12-
go get -u github.com/sergi/go-diff/...
12+
go get -u github.com/gkampitakis/go-diff/...
1313
```
1414

1515
## Usage
@@ -22,7 +22,7 @@ package main
2222
import (
2323
"fmt"
2424

25-
"github.com/sergi/go-diff/diffmatchpatch"
25+
"github.com/gkampitakis/go-diff/diffmatchpatch"
2626
)
2727

2828
const (
@@ -41,11 +41,11 @@ func main() {
4141

4242
## Found a bug or are you missing a feature in go-diff?
4343

44-
Please make sure to have the latest version of go-diff. If the problem still persists go through the [open issues](https://github.com/sergi/go-diff/issues) in the tracker first. If you cannot find your request just open up a [new issue](https://github.com/sergi/go-diff/issues/new).
44+
Please make sure to have the latest version of go-diff. If the problem still persists go through the [open issues](https://github.com/gkampitakis/go-diff/issues) in the tracker first. If you cannot find your request just open up a [new issue](https://github.com/gkampitakis/go-diff/issues/new).
4545

4646
## How to contribute?
4747

48-
You want to contribute to go-diff? GREAT! If you are here because of a bug you want to fix or a feature you want to add, you can just read on. Otherwise we have a list of [open issues in the tracker](https://github.com/sergi/go-diff/issues). Just choose something you think you can work on and discuss your plans in the issue by commenting on it.
48+
You want to contribute to go-diff? GREAT! If you are here because of a bug you want to fix or a feature you want to add, you can just read on. Otherwise we have a list of [open issues in the tracker](https://github.com/gkampitakis/go-diff/issues). Just choose something you think you can work on and discuss your plans in the issue by commenting on it.
4949

5050
Please make sure that every behavioral change is accompanied by test cases. Additionally, every contribution must pass the `lint` and `test` Makefile targets which can be run using the following commands in the repository root directory.
5151

diffmatchpatch/benchutil_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@
88

99
package diffmatchpatch
1010

11-
import (
12-
"io/ioutil"
13-
)
11+
import "os"
1412

1513
const testdataPath = "../testdata/"
1614

17-
func speedtestTexts() (s1 string, s2 string) {
18-
d1, err := ioutil.ReadFile(testdataPath + "speedtest1.txt")
15+
func speedtestTexts() (s1, s2 string) {
16+
d1, err := os.ReadFile(testdataPath + "speedtest1.txt")
1917
if err != nil {
2018
panic(err)
2119
}
22-
d2, err := ioutil.ReadFile(testdataPath + "speedtest2.txt")
20+
d2, err := os.ReadFile(testdataPath + "speedtest2.txt")
2321
if err != nil {
2422
panic(err)
2523
}

0 commit comments

Comments
 (0)