Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
chore: switch ci and update linter (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma committed Jul 26, 2021
1 parent 1c24a99 commit 413798a
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 35 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
push:
branches:
- master
pull_request:

name: run tests
jobs:
test:

strategy:
matrix:
go-version: [ 1.15, 1.16 ]
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v1.41.1

steps:
- name: Install Go
if: success()
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

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

- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run linter
uses: golangci/golangci-lint-action@v2
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}

- name: Run tests
run: go test -covermode=count -coverprofile=coverage.out ./...

- name: Convert coverage.out to coverage.lcov
uses: jandelgado/gcov2lcov-action@v1.0.6
- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
38 changes: 38 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
run:
tests: false
timeout: 5m

linters-settings:
cyclop:
max-complexity: 20
skip-tests: true
gofumpt:
extra-rules: true

linters:
enable-all: true
disable:
- interfacer # deprecated
- scopelint # deprecated
- maligned # deprecated
- golint # deprecated
- dupl
- exhaustive
- exhaustivestruct
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- goerr113
- gomnd
- lll
- nlreturn
- wrapcheck
- wsl

issues:
exclude-use-default: false
exclude-rules:
- path: ptr.go
linters:
- gosec
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Nicholas Wiersma
Copyright (c) 2021 Nicholas Wiersma

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
![Logo](http://svg.wiersma.co.za/hamba/project?title=slices&tag=Slice%20helper%20functions)

[![Go Report Card](https://goreportcard.com/badge/github.com/hamba/slices)](https://goreportcard.com/report/github.com/hamba/slices)
[![Build Status](https://travis-ci.com/hamba/slices.svg?branch=master)](https://travis-ci.com/hamba/slices)
[![Build Status](https://github.com/hamba/cmd/actions/workflows/test.yml/badge.svg)](https://github.com/hamba/cmd/actions)
[![Coverage Status](https://coveralls.io/repos/github/hamba/slices/badge.svg?branch=master)](https://coveralls.io/github/hamba/slices?branch=master)
[![GoDoc](https://godoc.org/github.com/hamba/slices?status.svg)](https://godoc.org/github.com/hamba/slices)
[![Go Reference](https://pkg.go.dev/badge/github.com/hamba/slices.svg)](https://pkg.go.dev/github.com/hamba/slices)
[![GitHub release](https://img.shields.io/github/release/hamba/slices.svg)](https://github.com/hamba/slices/releases)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/hamba/slices/master/LICENSE)

Expand Down
2 changes: 2 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package slices implements fast slice operations.
package slices
4 changes: 2 additions & 2 deletions internal/gen/gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion intersect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

type intersectFn func(sptr, optr unsafe.Pointer) interface{}

// Intersection returns a slice with the intersection of slice and other.
// Intersect returns a slice with the intersection of slice and other.
// When the slices are the same, slice is returned.
func Intersect(slice, other interface{}) interface{} {
fn, ok := intersectOf(slice, other)
Expand Down

0 comments on commit 413798a

Please sign in to comment.