Skip to content

Commit 726c51e

Browse files
authored
Merge pull request #29 from maratori/release
Prepare release
2 parents 7c5abfa + 871bdaa commit 726c51e

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
pull_request:
1111
push:
1212
branches:
13-
- master
13+
- main
1414
schedule:
1515
- cron: "0 0 * * 1" # Every Monday
1616

README.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# testpackage <br> [![CI](https://github.com/maratori/testpackage/actions/workflows/ci.yaml/badge.svg)](https://github.com/maratori/testpackage/actions/workflows/ci.yaml) [![codecov](https://codecov.io/gh/maratori/testpackage/branch/master/graph/badge.svg)](https://codecov.io/gh/maratori/testpackage) [![codebeat badge](https://codebeat.co/badges/9c74d700-ebf8-4b76-8405-1950874576c4)](https://codebeat.co/projects/github-com-maratori-testpackage-master) [![Maintainability](https://api.codeclimate.com/v1/badges/bf753d7560c8e4aa5cf0/maintainability)](https://codeclimate.com/github/maratori/testpackage/maintainability) [![Go Report Card](https://goreportcard.com/badge/github.com/maratori/testpackage)](https://goreportcard.com/report/github.com/maratori/testpackage) [![GitHub](https://img.shields.io/github/license/maratori/testpackage.svg)](LICENSE) [![GoDoc](https://godoc.org/github.com/maratori/testpackage?status.svg)](http://pkg.go.dev/github.com/maratori/testpackage)
1+
# testpackage <br> [![CI][ci-img]][ci-link] [![Codecov][codecov-img]][codecov-link] [![Codebeat][codebeat-img]][codebeat-link] [![Maintainability][codeclimate-img]][codeclimate-link] [![Go Report Card][goreportcard-img]][goreportcard-link] [![License][license-img]][license-link] [![Go Reference][godoc-img]][godoc-link]
22

33
**testpackage** is a golang linter that makes you use a separate `_test` package.
44

@@ -23,11 +23,10 @@ More detailed articles on this topic:
2323

2424
## Usage
2525

26-
The best way is to use [golangci-lint](https://github.com/golangci/golangci-lint).
27-
It includes **testpackage** linter started from v1.25.0 and higher.
26+
The best way is to use [golangci-lint](https://golangci-lint.run/). It includes [testpackage](https://golangci-lint.run/usage/linters/#list-item-testpackage) and a lot of other great linters.
2827

2928
### Install
30-
See [install section](https://github.com/golangci/golangci-lint#install) of readme.
29+
See [official site](https://golangci-lint.run/usage/install/).
3130

3231
### Configuration
3332
**testpackage** is disabled by default. To enable it, add the following to your `.golangci.yml`:
@@ -45,15 +44,15 @@ Here are the default values:
4544
linters-settings:
4645
testpackage:
4746
skip-regexp: (export|internal)_test\.go
48-
allow-packages: main
47+
allow-packages:
48+
- main
4949
```
5050
5151
### Run
5252
```shell script
5353
golangci-lint run
5454
```
5555

56-
5756
## Usage as standalone linter
5857

5958
### Install
@@ -84,7 +83,7 @@ Flags:
8483
-skip-regexp string
8584
regexp pattern to skip file by name. To not skip files use -skip-regexp="^$" (default "(export|internal)_test\\.go")
8685
-allow-packages string
87-
comma separated list of packages that don't end with _test that tests are allowed to be in
86+
comma separated list of packages that don't end with _test that tests are allowed to be in (default "main")
8887
-V print version and exit
8988
-c int
9089
display offending line with this many lines of context (default -1)
@@ -100,13 +99,26 @@ Flags:
10099
emit JSON output
101100
-memprofile string
102101
write memory profile to this file
102+
-test
103+
indicates whether test files should be analyzed, too (default true)
103104
-trace string
104105
write trace log to this file
105106
```
106107

108+
## Contributors
109+
* [maratori](https://github.com/maratori)
110+
* [G-Rath](https://github.com/G-Rath)
107111

108112
## Changelog
109113

114+
### [v1.1.0] - 2022-06-22
115+
116+
#### Changed
117+
* Allow tests in `main` package by default and add flag `-allow-packages` to allow tests without `_test` suffix (thanks [G-Rath](https://github.com/G-Rath))
118+
* Update golang to 1.18
119+
* Migrate to [github actions](https://github.com/maratori/testpackage/actions/workflows/ci.yaml) from travis-ci
120+
* Update golangci-lint to v1.46.2
121+
110122
### [v1.0.1] - 2020-04-22
111123

112124
#### Changed
@@ -119,5 +131,21 @@ Flags:
119131

120132
#### Added
121133
* Go Analyzer to check the name of test package
122-
* main.go to run the analyzer
134+
* `main.go` to run the analyzer
123135
* MIT [license](LICENSE)
136+
137+
138+
[ci-img]: https://github.com/maratori/testpackage/actions/workflows/ci.yaml/badge.svg
139+
[ci-link]: https://github.com/maratori/testpackage/actions/workflows/ci.yaml
140+
[codecov-img]: https://codecov.io/gh/maratori/testpackage/branch/main/graph/badge.svg?token=Pa334H8xEh
141+
[codecov-link]: https://codecov.io/gh/maratori/testpackage
142+
[codebeat-img]: https://codebeat.co/badges/c5ab864e-dbe5-424a-93ae-75ad98c1ea55
143+
[codebeat-link]: https://codebeat.co/projects/github-com-maratori-testpackage-main
144+
[codeclimate-img]: https://api.codeclimate.com/v1/badges/bf753d7560c8e4aa5cf0/maintainability
145+
[codeclimate-link]: https://codeclimate.com/github/maratori/testpackage/maintainability
146+
[goreportcard-img]: https://goreportcard.com/badge/github.com/maratori/testpackage
147+
[goreportcard-link]: https://goreportcard.com/report/github.com/maratori/testpackage
148+
[license-img]: https://img.shields.io/github/license/maratori/testpackage.svg
149+
[license-link]: /LICENSE
150+
[godoc-img]: https://pkg.go.dev/badge/github.com/maratori/testpackage.svg
151+
[godoc-link]: https://pkg.go.dev/github.com/maratori/testpackage

0 commit comments

Comments
 (0)