refdir

command module
v0.0.0-...-878e830 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 2 Imported by: 0

README

refdir — Go linter that can enforce reference-based ordering of definitions in a file

Go Report Card

This linter was start as a fork from the vertfn linter by @nikolaydubina. However it is a significant departure in scope from that linter.

Disclaimer: false positives; practically this is useful for "exploration" rather than for "enforcement"

Vertical Ordering
In general we want function call dependencies to point in the downward direction. That is, a function that is called should be bellow a function that does the calling. This creates a nice flow down the source code module from the high level to low level. As in newspaper articles, we expect the most important concepts to come first, and we expect them to be expressed with the least amount of polluting detail. We expect the low-level details to come last. This allows us to skim source files, getting the gist from the frist few functions, without having to immerge ourselves in the details.
— Clean Code, Chapter 5, p84, Robert C. Martin, 2009

go install github.com/devnev/refdir@latest
refdir --verbose ./...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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