Skip to content

Latest commit

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

difflint

Go Reference

🔍 Git-based linter tool that scans code changes for compliance with defined rules in source code.

Installation

go get -u github.com/EthanThatOneKid/difflint

Usage

difflint --help

Single file

# File: ./main.py#LINT.IFprint("Edit me first!")
#LINT.END bar#LINT.IF :barprint("Edit me second!")
#LINT.END

Multiple files

# File ./foo.py#LINT.IFprint("Edit me first!")
#LINT.END bar
# File: ./main.py#LINT.IF ./foo.py:barprint("Edit me second!")
#LINT.END

Exhaustive switch statement

In programming languages lacking a comprehensive match statement for enumerations, our only option is to verify whether the switch statement aligns with the enumerated type.

//LINT.IFenumThing{ONE=1,TWO=2,}//LINT.END :thing_enum//LINT.IF :thing_enumswitch(thing){caseThing.ONE: {returndoThingOne();}caseThing.TWO: {returndoThingTwo();}}//LINT.END

Custom file extensions

git diff | difflint --ext_map="difflint.json"

difflint.json

{
"yaml": ["#LINT.?"]
}

Development

Run the tool from source with the Go toolchain:

go run cli/main.go --help

Created with 💖 by @EthanThatOneKid

About

🔍 Git-based linter tool that scans code changes for compliance with defined rules in source code.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages