Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Merge d0659e1 into 3541ca7
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Mar 8, 2020
2 parents 3541ca7 + d0659e1 commit 9877dc0
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 121 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
@@ -0,0 +1,35 @@
name: build
on:
push:
branches:
- "**"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- name: setup go
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: checkout
uses: actions/checkout@v1
- name: build
run: make
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1.0.0
with:
infile: coverage.out
outfile: coverage.lcov
if: "matrix.os == 'ubuntu-latest'"
- name: coveralls
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
if: "matrix.os == 'ubuntu-latest'"
7 changes: 3 additions & 4 deletions .gitignore
@@ -1,7 +1,6 @@
vendor
uniq2

### https://raw.github.com/github/gitignore/5c5a1b536b6f9bf11515518f03d58addaf29f681/Go.gitignore
### https://raw.github.com/github/gitignore/599646e9d0a26283d67715dead8f26e0eb2df753/Go.gitignore

# Binaries for programs and plugins
*.exe
Expand All @@ -20,7 +19,7 @@ uniq2
# vendor/


### https://raw.github.com/github/gitignore/5c5a1b536b6f9bf11515518f03d58addaf29f681/Global/Emacs.gitignore
### https://raw.github.com/github/gitignore/599646e9d0a26283d67715dead8f26e0eb2df753/Global/Emacs.gitignore

# -*- mode: gitignore; -*-
*~
Expand Down Expand Up @@ -73,7 +72,7 @@ flycheck_*.el



### https://raw.github.com/github/gitignore/5c5a1b536b6f9bf11515518f03d58addaf29f681/Global/macOS.gitignore
### https://raw.github.com/github/gitignore/599646e9d0a26283d67715dead8f26e0eb2df753/Global/macOS.gitignore

# General
.DS_Store
Expand Down
17 changes: 0 additions & 17 deletions Gopkg.lock

This file was deleted.

34 changes: 0 additions & 34 deletions Gopkg.toml

This file was deleted.

21 changes: 19 additions & 2 deletions Makefile
@@ -1,6 +1,7 @@
GO=go
NAME := uniq2
VERSION := 1.0.1
VERSION := 1.0.2
DIST := $(NAME)-$(VERSION)

all: test build

Expand All @@ -18,8 +19,24 @@ update_version:
test: setup
$(GO) test -covermode=count -coverprofile=coverage.out $$(go list ./... | grep -v vendor)

# refer from https://pod.hatenablog.com/entry/2017/06/13/150342
define _createDist
mkdir -p dist/$(1)_$(2)/$(DIST)
GOOS=$1 GOARCH=$2 go build -o dist/$(1)_$(2)/$(DIST)/$(NAME)$(3) cmd/$(NAME)/main.go
cp -r README.md LICENSE dist/$(1)_$(2)/$(DIST)
tar cfz dist/$(DIST)_$(1)_$(2).tar.gz -C dist/$(1)_$(2) $(DIST)
endef

dist: build
@$(call _createDist,darwin,amd64,)
@$(call _createDist,darwin,386,)
@$(call _createDist,windows,amd64,.exe)
@$(call _createDist,windows,386,.exe)
@$(call _createDist,linux,amd64,)
@$(call _createDist,linux,386,)

build: setup
cd cmd/uniq2; $(GO) build -o $(NAME) -v
$(GO) build -o $(NAME) -v cmd/$(NAME)/main.go

clean:
$(GO) clean
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@
[![codebeat badge](https://codebeat.co/badges/855266ea-99d4-4d80-ac43-81a1712f0f90)](https://codebeat.co/projects/github-com-tamada-uniq2-master)
[![Go Report Card](https://goreportcard.com/badge/github.com/tamada/uniq2)](https://goreportcard.com/report/github.com/tamada/uniq2)
[![License](https://img.shields.io/badge/License-WTFPL-blue.svg)](https://github.com/tamada/uniq2/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/Version-1.0.1-yellowgreen.svg)](https://github.com/tamada/uniq2/releases/tag/v1.0.1)
[![Version](https://img.shields.io/badge/Version-1.0.2-yellowgreen.svg)](https://github.com/tamada/uniq2/releases/tag/v1.0.2)

# uniq2

Expand Down
4 changes: 2 additions & 2 deletions cmd/uniq2/main.go
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"os"

flag "github.com/ogier/pflag"
flag "github.com/spf13/pflag"
"github.com/tamada/uniq2/lib"
)

const VERSION = "1.0.1"
const VERSION = "1.0.2"

func printHelp(appName string) {
fmt.Printf(`%s [OPTIONS] [INPUT [OUTPUT]]
Expand Down
28 changes: 26 additions & 2 deletions docs/content/_index.md
Expand Up @@ -7,7 +7,7 @@ title: uniq2
[![codebeat badge](https://codebeat.co/badges/855266ea-99d4-4d80-ac43-81a1712f0f90)](https://codebeat.co/projects/github-com-tamada-uniq2-master)
[![Go Report Card](https://goreportcard.com/badge/github.com/tamada/uniq2)](https://goreportcard.com/report/github.com/tamada/uniq2)
[![License](https://img.shields.io/badge/License-WTFPL-blue.svg)](https://github.com/tamada/uniq2/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/Version-1.0.1-yellowgreen.svg)](https://github.com/tamada/uniq2/releases/tag/v1.0.1)
[![Version](https://img.shields.io/badge/Version-1.0.2-yellowgreen.svg)](https://github.com/tamada/uniq2/releases/tag/v1.0.2)

## Description

Expand All @@ -19,7 +19,16 @@ When deleting not continuous duplicate lines, we use `sort` command together, in

We want to delete not continuous duplicated lines with remaining the order.

## Install
### Install by Homebrew

Simply type the following commands.

```sh
$ brew tap tamada/brew
$ brew install uniq2
```

### Install by Go

### Install by Homebrew

Expand All @@ -38,6 +47,21 @@ Simply type the following command.
$ go get github.com/tamada/uniq2
```

## Usage

```
uniq2 [OPTIONS] [INPUT [OUTPUT]]
OPTIONS
-a, --adjacent delete only adjacent duplicated lines.
-d, --delete-lines only prints deleted lines.
-i, --ignore-case case sensitive.
-h, --help print this message.
INPUT gives file name of input. If argument is single dash ('-')
or absent, the program read strings from stdin.
OUTPUT represents the destination.
```

## License

[WTFPL](https://github.com/tamada/uniq2/blob/master/LICENSE)
4 changes: 3 additions & 1 deletion docs/layouts/partials/blog-post-list.html
Expand Up @@ -3,7 +3,8 @@ <h1>{{ .Title }}</h1>
{{ .Content }}

<ul>
{{ range where .Pages.ByPublishDate.Reverse "Section" "post" }}
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages.ByPublishDate.Reverse }}
<li>
{{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }}
{{ .PublishDate.Format $dateFormat }}
Expand All @@ -13,3 +14,4 @@ <h1>{{ .Title }}</h1>
</li>
{{ end }}
</ul>

17 changes: 2 additions & 15 deletions go.mod
@@ -1,20 +1,7 @@
module github.com/tamada/uniq2

go 1.12
go 1.14

require (
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/vcs v1.13.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/boltdb/bolt v1.3.1 // indirect
github.com/golang/dep v0.5.4 // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/jmank88/nuts v0.3.0 // indirect
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443 // indirect
github.com/ogier/pflag v0.0.1
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353 // indirect
golang.org/x/lint v0.0.0-20190409202823-959b441ac422 // indirect
golang.org/x/tools v0.0.0-20190702201734-44aeb8b7c377 // indirect
github.com/spf13/pflag v1.0.5
)
45 changes: 2 additions & 43 deletions go.sum
@@ -1,43 +1,2 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/vcs v1.13.0 h1:USF5TvZGYgIpcbNAEMLfFhHqP08tFZVlUVrmTSpqnyA=
github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/dep v0.5.4 h1:WfV5qbGwsBNUDhk+pfI6emWm7SdDFsnSWkqCMNG3BRs=
github.com/golang/dep v0.5.4/go.mod h1:6RZ2Wai7dSWk7qL55sDYk+8UPFqcW7all2KDBraPPFA=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/jmank88/nuts v0.3.0 h1:UZUboV1LXVkBUTHLRTEZrDfAL7QYgj9jEsBCiJHrxEM=
github.com/jmank88/nuts v0.3.0/go.mod h1:kTf5cyoLibZUQg9Lns/gteKO1d/5XrhacD1QVKviAKk=
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443 h1:+2OJrU8cmOstEoh0uQvYemRGVH1O6xtO2oANUWHFnP0=
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443/go.mod h1:JbxfV1Iifij2yhRjXai0oFrbpxszXHRx1E5RuM26o4Y=
github.com/ogier/pflag v0.0.1 h1:RW6JSWSu/RkSatfcLtogGfFgpim5p7ARQ10ECk5O750=
github.com/ogier/pflag v0.0.1/go.mod h1:zkFki7tvTa0tafRvTBIZTvzYyAu6kQhPZFnshFFPE+g=
github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg=
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353 h1:tnWWLf0nI2TI62Wd/ZOea4XYqE+y1sf2pdm+VItsc0c=
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353/go.mod h1:5HStXbIikwtDAgAIqiQIqVgMn7mlvZa6PTpwiAVYGYg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422 h1:QzoH/1pFpZguR8NrRHLcO6jKqfv2zpuSqZLgdm7ZmjI=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190702201734-44aeb8b7c377 h1:P/0pu7r+pn3Fkv7pyRpb7tBawImpURm2mTIbR6MadCc=
golang.org/x/tools v0.0.0-20190702201734-44aeb8b7c377/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

0 comments on commit 9877dc0

Please sign in to comment.