Skip to content

Commit

Permalink
Merge pull request #24 from ahmedkamals/improvement/updating-dependen…
Browse files Browse the repository at this point in the history
…cies

⬆️ [patch] Updating dependencies.
  • Loading branch information
architeacher committed Mar 31, 2021
2 parents 6bc096a + e99f036 commit 45143fd
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ alias:
VALIDATE: true
working_directory: /go/src/github.com/ahmedkamals/colorize
docker:
- image: circleci/golang:1.14.6
- image: circleci/golang:1.16.2
environment:
GOPATH: "/go"
GO111MODULE: "on"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ jobs:
name: Build
strategy:
matrix:
go-version: [1.14.x]
go-version: [1.16.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v1

- name: Cache Go modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
Expand All @@ -36,15 +36,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.16

- name: Checkout code
uses: actions/checkout@v1

- name: Cache Go modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
Expand All @@ -61,7 +61,7 @@ jobs:
run: |
make coverage-html
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v2
with:
name: coverage
path: .go/tests/coverage/index.html
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ branches:
jobs:
include:
- stage: Coverage
go: 1.14
go: 1.16
env: COVERAGE=true
install:
- make get-deps
- &integration-tests
stage: Integration tests
go: 1.14.x
go: 1.16.x
os: linux
env:
- Build=true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Table of Contents
### Prerequisites
* [Golang 1.14 or later][2].
* [Golang 1.15 or later][2].
### Installation
Expand Down
4 changes: 2 additions & 2 deletions assets/git/hooks/commit-msg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if grep -q -i -e "WIP" -e "work in progress" "$1"; then
fi
fi

if ! grep -iqE "^:[[:alnum:]]+:\s{1}.*" "$1"; then
if ! grep -qE "^:[a-z0-9_-]+:\s{1}.*" "$1"; then
read -p "You're about to commit without an icon, do you want to continue? [y|n] " -n 1 -r < /dev/tty
echo
if echo "$REPLY" | grep -E '^[Nn]$' > /dev/null; then
Expand All @@ -40,7 +40,7 @@ if ! grep -iqE "^:[[:alnum:]]+:\s{1}.*" "$1"; then
fi
fi

if ! grep -iqE ".*\[(major|minor|patch)\].*" "$1"; then
if ! grep -qE ".*\s\[(major|minor|patch)\]\s.*" "$1"; then
read -p "You're about to commit without release type [major|minor|patch], do you want to continue? [y|n] " -n 1 -r < /dev/tty
echo
if echo "$REPLY" | grep -E '^[Nn]$' > /dev/null; then
Expand Down
4 changes: 2 additions & 2 deletions build/mk/Makefile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ BENCH_PROFILE ?= $(BENCH_TESTS_PATH)/profile.bin
BENCH_TESTS_COUNT ?= 3

## Bench tests timeout.
BENCH_TEST_TIMEOUT ?= 8m
BENCH_TEST_TIMEOUT ?= 18m

## The number of parallel tests.
PARALLEL_TESTS ?= 8

## Test timeout.
TEST_TIMEOUT ?= 8s
TEST_TIMEOUT ?= 18s

## Test time multiplier flag name.
TEST_TIME_MULTIPLIER_FLAG ?= timeMultiplier
Expand Down
2 changes: 1 addition & 1 deletion build/mk/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ endif

BUILD_ENV ?= $(BUILD_ENV:)

GO_BUILD_FLAGS ?= -i -a -installsuffix cgo
GO_BUILD_FLAGS ?= -a -installsuffix cgo

EXTLD_FLAGS ?=

Expand Down
21 changes: 11 additions & 10 deletions build/mk/coverage.mk
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
COVERAGE_PACKAGES := /
COVERAGE_PACKAGES := $(SRC_PKGS)

define coverPackage
$(GO) test \
-cover \
-covermode=$(COVERAGE_MODE) \
-coverprofile $(COVERAGE_PATH)/$(1).part \
-parallel $(PARALLEL_TESTS) \
-tags $(GO_TAGS) \
-timeout $(TEST_TIMEOUT) \
$(GO_FLAGS) \
$(APP_DIR)/$(1) 2>&1;
$(eval FILE_NAME=$(shell basename $(1) 2>&1))
$(GO) test \
-cover \
-covermode=$(COVERAGE_MODE) \
-coverprofile $(COVERAGE_PATH)/$(FILE_NAME).part \
-parallel $(PARALLEL_TESTS) \
-tags $(GO_TAGS) \
-timeout $(TEST_TIMEOUT) \
$(GO_FLAGS) \
$(1) 2>&1;
endef

# Goveralls binary.
Expand Down
6 changes: 5 additions & 1 deletion build/mk/utils.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
utils: clean format help list nuke
utils: clean format help list list-modules nuke

clean: clean-bin clean-coverage clean-version clean-tests ## to clean up all generated directories/files.

Expand All @@ -16,6 +16,10 @@ help: ## to get help about the targets.
list: ## to list all targets.
awk -F':' '/^[a-z0-9][^$#\/\t=]*:([^=]|$$)/ {split($$1,A,/ /);for(i in A)printf "$(LIST_CLR)%-30s$(NO_CLR)\n", A[i]}' $(MAKEFILE_LIST) | sort -u 2>&1

list-modules: ## to list go modules.
printf "$(WARN_CLR)$(MSG_PRFX) ℹ️ Installed Go modules$(MSG_SFX)$(NO_CLR)\n"
$(GO) list -u -m all 2>&1

nuke: clean ## to do clean up and enforce removing the corresponding installed archive or binary.
printf "$(WARN_CLR)$(MSG_PRFX) 🧹 Cleaning up Go dependencies$(MSG_SFX)$(NO_CLR)\n"
$(GO) clean -i -r -cache --modcache -testcache $(GO_FLAGS) ./... net 2>&1
6 changes: 3 additions & 3 deletions colorize.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ func (clr color) format(mode uint8) string {
// Equals compares style with a given style,
// and returns true if they are the same.
func (s Style) Equals(style Style) bool {
if (s.Foreground == nil && style.Foreground != nil) ||
if len(s.Font) != len(style.Font) ||
(s.Foreground == nil && style.Foreground != nil) ||
(s.Foreground != nil && !s.Foreground.Equals(style.Foreground)) ||
(s.Background == nil && style.Background != nil) ||
(s.Background != nil && !s.Background.Equals(style.Background)) ||
len(s.Font) != len(style.Font) {
(s.Background != nil && !s.Background.Equals(style.Background)) {
return false
}

Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
module github.com/ahmedkamals/colorize

go 1.14
go 1.16

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-isatty v0.0.12
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.7.0
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
13 changes: 8 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04 h1:cEhElsAv9LUt9ZUUocxzWe05oFLVd+AA2nstydTeI8g=
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 45143fd

Please sign in to comment.