Skip to content

Commit

Permalink
Prepare for first release (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
k3rn31 authored Jul 24, 2022
1 parent b1fb7b1 commit 20cb210
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 20 deletions.
54 changes: 44 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,61 @@
project_name: gremlins
before:
hooks:
- make clean
- go mod download
builds:
- main: ./cmd/gremlins
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- 386
- amd64
- arm64
ignore:
- goos: darwin
goarch: 386
release:
github:
draft: true
prerelease: auto
nfpms:
- homepage: https://github.com/k3rn31/gremlins
description: A mutation testing tool for Go.
license: Apache 2.0 License
maintainer: Davide Petilli <[email protected]>
formats:
- deb
- rpm
brews:
- tap:
owner: k3rn31
name: gremlins-tap
homepage: https://github.com/k3rn31/gremlins
description: A mutation testing tool for Go.
license: Apache 2.0 License
skip_upload: auto
test: |
system "#{bin}/gremlins --version"
checksum:
name_template: 'checksums.txt'
source:
enabled: true
changelog:
skip: false
use: github
sort: asc
filters:
exclude:
- '^test:'
- '^docs:'
- '^chore:'
- 'merge conflict'
- '(?i)^docs?:'
- '(?i)^docs\([^:]+\):'
- '(?i)^docs\[[^:]+\]:'
- '^tests?:'
- '(?i)^dev:'
- '^build\(deps\): bump .* in /docs \(#\d+\)'
- '^build\(deps\): bump .* in /\.github/peril \(#\d+\)'
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
release:
draft: true
prerelease: auto
snapshot:
name_template: "{{ .Tag }}-next"
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This is the official list of Gremlins authors for copyright purposes.

Davide Petilli <davide@petilli.me>
Davide Petilli <davide.petilli@gmail.com>
64 changes: 55 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Gremlins is a mutation testing tool for Go.

- [What is Mutation Testing](#what-is-mutation-testing)
- [How to Use Gremlins](#how-to-use-gremlins)
- [Obtain and install](#obtain-and-install)
- [Usage](#usage)
- [Supported Mutations](#supported-mutations)
- [Conditionals Boundaries](#conditionals-boundaries)
- [Conditionals Negation](#conditionals-negation)
Expand All @@ -28,7 +30,8 @@ Gremlins is a mutation testing tool for Go.

## What is Mutation Testing

Code coverage is unreliable as a measure of test quality. It is too easy to have tests that exercise a piece of code but don't
Code coverage is unreliable as a measure of test quality. It is too easy to have tests that exercise a piece of code but
don't
test anything at all.
_Mutation testing_ works by mutating the code exercised by the tests and verifying if the mutation is caught by
the test suite. Imagine _gremlins_ going into your code and messing around: will your test suit catch their damage?
Expand All @@ -37,6 +40,47 @@ Here is a nice [intro to mutation testing](https://pedrorijo.com/blog/intro-muta

## How to use Gremlins

### Obtain and install

#### Linux

Download a `.deb` or `.rpm` file from the [release page](https://github.com/k3rn31/gremlins/releases) and install
with `dpkg -i` and `rpm -i` respectively.

#### MacOS

On macOS, you can use [Homebrew](https://brew.sh/) to install by first tapping the repository. As of now, we use
a homebrew tap.

```shell
brew tap k3rn31/gremlins https://github.com/k3rn31/gremlins-tap
brew install gremlins
```

#### Manual

- Download the binary appropriate for your platform from the [release page](https://github.com/k3rn31/gremlins/releases)
.
- Put the `gremlins` executable somewhere in your `PATH` (ex. `/usr/local/bin`).

#### From source

To build Gremlins you need the Go compiler, make and golangci-lint for linting.
You can clone the Gremlins repository and then build it:

```shell
git clone https://github.com/k3rn31/gremlins.git
```

Ad then:

```
cd gremlins
make
```

### Usage

To execute a mutation test run, from the root of a Go module execute:

```shell
Expand Down Expand Up @@ -73,15 +117,15 @@ Example:

```go
if a > b {
// Do something
// Do something
}
```

will be changed to

```go
if a < b {
// Do something
// Do something
}
```

Expand All @@ -100,15 +144,15 @@ Example:

```go
if a == b {
// Do something
// Do something
}
```

will be changed to

```go
if a != b {
// Do something
// Do something
}
```

Expand All @@ -123,34 +167,35 @@ Example:

```go
func incr(i int) int
return i++
return i++
}
```

will be changed to

```go
func incr(i int) int {
return i--
return i--
}
```

#### Invert Negatives

It will invert negative numbers.

Example:

```go
func negate(i int) int {
return -i
return -i
}
```

will be changed to

```go
func negate(i int) int {
return +i
return +i
}
```

Expand Down Expand Up @@ -207,6 +252,7 @@ There is not much around, except from:
See [contributing](CONTRIBUTING.md).

## License

Gremlins is released under the [Apache 2.0 License](LICENSE)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fk3rn31%2Fgremlins.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fk3rn31%2Fgremlins?ref=badge_large)

0 comments on commit 20cb210

Please sign in to comment.