Giter VIP home page Giter VIP logo

alphavet's Introduction

GoDoc Go Report Card license

alphavet

This is a simple linter which is designed to report upon functions which are not implemented in alphabetical order within files.

The motivation behind this tool was twofold:

  • I find it easier to navigate functions if they are ordered alphabetically.
    • Most IDEs offer a tree/outline view which is ordered alphabetically, and the contents and the tree should match!
  • Once I realized a linter, driven by "go vet", could be named "alphavet" I couldn't resist the temptation to hack it up.
    • Even though this could just has easily have been a portable Perl script.

Installation

If you have a working golang toolset you should be able to install by:

go install github.com/skx/alphavet/cmd/alphavet@latest

Usage

The linter is designed to be driven by go vet like so:

$ go vet -vettool=$(which alphavet) ./...

By default the two functions init and main are excluded from the alphabetical ordering requirement. If you wish to exclude additional functions you may do so, via the -exclude parameter:

$ go vet -vettool=$(which alphavet) -exclude=init,main,New ./...

Sample Output

Sample output would look something like this:

$ go vet -vettool=$(which alphavet) ./...
# github.com/skx/gobasic/builtin
./builtin.go:67:1: function Get should have been before Register
./misc_test.go:21:1: function LineEnding should have been before StdInput
./misc_test.go:29:1: function StdError should have been before StdOutput
./misc_test.go:33:1: function Data should have been before StdError

Github Setup

This repository is configured to run tests upon every commit, and when pull-requests are created/updated. The testing is carried out via .github/run-tests.sh which is used by the github-action-tester action.

Bug reports?

Please do feel free to report any issues you see with the code, or the results.

Feature requests are also welcome, although I'd prefer to avoid having excessive flags.

Steve

alphavet's People

Contributors

skx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

alphavet's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.