Skip to content

Commit

Permalink
update README.md: golangci-lint support
Browse files Browse the repository at this point in the history
  • Loading branch information
moricho committed Oct 17, 2020
1 parent 88fabab commit dacf9d6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
# tparallel

[![tparallel](https://github.com/moricho/tparallel/workflows/tparallel/badge.svg?branch=master)](https://github.com/moricho/tparallel/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/moricho/tparallel)](https://goreportcard.com/report/github.com/moricho/tparallel)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)

`tparallel` finds inappropriate usage of `t.Parallel()` method in your Go test codes.
It detects the following:
It detects the following:

- `t.Parallel()` is called in either a top-level test function or a sub-test function only
- Although `t.Parallel()` is called in the sub-test function, it is post-processed by `defer` instead of `t.Cleanup()`
This tool was inspired by this blog: [Go言語でのテストの並列化 〜t.Parallel()メソッドを理解する〜](https://engineering.mercari.com/blog/entry/how_to_use_t_parallel/)

This tool was inspired by this blog: [Go 言語でのテストの並列化 〜t.Parallel()メソッドを理解する〜](https://engineering.mercari.com/blog/entry/how_to_use_t_parallel/)

## Installation

### From GitHub Releases

Please see [GitHub Releases](https://github.com/moricho/tparallel/releases).
Available binaries are:

- macOS
- Linux
- Windows

### macOS
``` sh

```sh
$ brew tap moricho/tparallel
$ brew install tparallel
```

### go get

```sh
$ go get -u github.com/moricho/tparallel/cmd/tparallel
```

## Usage

### golangci-lint

[golangci-lint](https://github.com/golangci/golangci-lint) now supports `tparallel`, so you can enable this linter and use in it.

### shell

```sh
$ go vet -vettool=`which tparallel` <pkgname>
```
Expand Down

0 comments on commit dacf9d6

Please sign in to comment.