self-lint

command module
v0.0.0-...-77fc450 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 7 Imported by: 0

README

self-lint

self-lint is a small linter for Go code.

install

$ go get -u github.com/mizkei/self-lint

usage

Write what you want to prohibit in your project.

  • import
    import packages
  • ref
    reference to variables, methods, or const
  • write
    write builtin function or statements

config file

prohibited-matter:
  - target:
      - global
    import:
      - github.com/mizkei/self-lint/_example/test
  - target:
      - github.com/mizkei/self-lint/_example/model
    ref:
      github.com/mizkei/self-lint/_example/time:
        - SetTime
        - ResetTime
  - target:
      - github.com/mizkei/self-lint/_example/data
    write:
      - if
      - switch
      - panic

run self-lint

$ self-lint -config=config_sample.yml ./...
data/data.go:12:2: forbidden to write if
data/data.go:13:3: forbidden to write panic
model/model.go:4:2: forbidden to import github.com/mizkei/self-lint/_example/test
model/model.go:22:7: forbidden to refer 'github.com/mizkei/self-lint/_example/time'.SetTime

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
_example

Jump to

Keyboard shortcuts

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