dogmavet

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2020 License: MIT Imports: 0 Imported by: 0

README

Dogma Vet Tool

Build Status Code Coverage Latest Version Documentation Go Report Card

This repositoriy contains a custom Go vet tool that implements checkers for common mistakes in Dogma application and message handler implementations.

Installation

GO111MODULE=off go get -u github.com/dogmatiq/dogmavet/...
Visual Studio Code

Assuming your GOROOT is in the default location, simply update the go.vetFlags setting as follows:

"go.vetFlags": [
  "-all",
  "-vettool=~/go/bin/dogmavet"
]

Checks

The following checks are currently supported:

  • Ensures Configure() methods call Identity() exactly once
  • Ensures Identity() is called with valid names and keys
  • Ensures identity keys are UUIDs, formatted as per RFC-4122

Fixes

The checkers are able to provide fixes to common problems, however it seems that go vet does not yet expose this information for consumptions by IDEs.

The fixers can be run manually using:

dogmavet -fix ./...

Please note that all of the following fixes will be applied:

  • Rename the configurer parameter name to c
  • Replace non-UUID identity keys with UUIDs
  • Reformat non-standard UUID representations by the RFC-4122 grammar

Caveats

The go vet command does not allow more than one -vettool argument to be provided. Furthermore, setting -vettool disables all of the standard checks.

As a workaround, dogmavet includes all of the standard checks along with the Dogma-specific ones.

See also vscode-go/issues#3219.

Documentation

Overview

Package dogmavet is a custom Go vet tool that checks and fixes common mistakes in Dogma application and message handler implementations.

Directories

Path Synopsis
cmd
internal
passes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL