Skip to content

Latest commit

History

History
54 lines (36 loc) 路 1.15 KB

DEVELOPING.md

File metadata and controls

54 lines (36 loc) 路 1.15 KB

Developer's Guide

This document explains how to build, test, and develop features for revive.

Installation

In order to install all the dependencies run:

go get -u github.com/mgechev/revive
cd $GOPATH/src/github.com/mgechev/revive

After that install the dependencies using go modules:

make install

Build

In order to build the project run:

make build

The command will produce the revive binary in the root of the project.

Development of rules

If you want to develop a new rule, follow as an example the already existing rules in the rule package.

All rules should implement the following interface:

type Rule interface {
	Name() string
	Apply(*File, Arguments) []Failure
}

Development of formatters

If you want to develop a new formatter, follow as an example the already existing formatters in the formatter package.

All formatters should implement the following interface:

type Formatter interface {
	Format(<-chan Failure, RulesConfig) (string, error)
	Name() string
}