8000 GitHub - danrneal/go-tools · GitHub
[go: up one dir, main page]

Skip to content
danrnealPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

76 Commits

Folders and files

Repository files navigation

go-tools

A collection of custom Go development and testing tools to improve productivity, code quality, and testing insights.

Features & Tools

1. Makefile & .golangci.yml

This repository provides a centralized Makefile and .golangci.yml configuration. The Makefile orchestrates fetching the latest configurations, installing necessary tools, formatting code, running tests, checking coverage diffs, and executing mutation testing.

2. cover-diff

A utility to compare test coverage between your current branch and a base branch (or commit) and report any regressions or uncovered new code. It generates and parses base coverage on the fly and compares it against your local coverage profile to ensure new code meets testing standards.

Usage:

cover-diff -coverprofile <path-to-coverage.out> [-base <branch-or-commit>]

3. gomutants-ignore

A post-processor for gomutants HTML reports that adds ignore filtering, dynamic line shifting, and self-healing ignore files.

It parses the HTML report generated by gomutants, synchronizes ignored mutations defined in .gomutants-ignore across Git history, marks matching surviving mutants as Ignored, and configures the report viewer to show only surviving mutants by default.

Advanced Features:

  • Intelligent Shifting: You can manually add a mutant to the .gomutants-ignore file. As you add, remove, or rename files and lines of code in your repository, the tool uses Git diffs to automatically update file paths and shift line numbers so ignored mutations stay synced with the codebase.
  • Self-Healing: During each run, the tool filters .gomutants-ignore against the current surviving mutations. If your test suite improves and kills a previously ignored mutation (or the mutated code is removed), the tool automatically removes that entry from .gomutants-ignore.

Ignore File Format: The tool expects a .gomutants-ignore file in the root of your project:

# format: path:line:column:mutatorName

internal/coverage/coverage.go:69:10:BRANCH_IF
internal/git/client.go:49:48:INTEGER_DECREMENT

Usage:

gomutants-ignore [-htmlreport <path-to-mutation-report.html>]

Setup & Usage

To use these tools and configurations in a new repository, you only need to copy the Makefile over. The Makefile will handle downloading the latest configurations and installing the required CLI tools.

  1. Download the Makefile to your project root:

    curl -sSfL https://raw.githubusercontent.com/danrneal/go-tools/main/Makefile -o Makefile
  2. Run the complete pipeline to install tools, fetch configs, and run all checks:

    make all
  3. For faster development cycles (skipping tool updates and full mutation testing), use:

    make fast

License

go-tools is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0