Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/walle/lll
Line length linter
https://github.com/walle/lll
Last synced: 3 months ago
JSON representation
Line length linter
- Host: GitHub
- URL: https://github.com/walle/lll
- Owner: walle
- License: mit
- Created: 2016-02-28T12:26:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-04T12:14:44.000Z (over 2 years ago)
- Last Synced: 2024-06-18T15:39:37.146Z (5 months ago)
- Language: Go
- Size: 34.2 KB
- Stars: 65
- Watchers: 4
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://img.shields.io/travis/walle/lll.svg?style=flat)](https://travis-ci.org/walle/lll)
[![Coverage](https://img.shields.io/codecov/c/github/walle/lll.svg?style=flat)](https://codecov.io/github/walle/lll)
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/walle/lll)
[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/walle/lll/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/walle/lll)](http:/goreportcard.com/report/walle/lll)# lll
Line length linter, used to enforce line length in files.
Support for only checking go files.## Installation
```shell
$ go get github.com/walle/lll/...
```## Usage
```shell
usage: lll [--maxlength MAXLENGTH] [--tabwidth TABWIDTH] [--goonly] [--skiplist SKIPLIST] [--vendor] [--files] [--exclude EXCLUDE] [INPUT [INPUT ...]]positional arguments:
inputoptions:
--maxlength MAXLENGTH, -l MAXLENGTH
max line length to check for [default: 80]
--tabwidth TABWIDTH, -w TABWIDTH
tab width in spaces [default: 1]
--goonly, -g only check .go files
--skiplist SKIPLIST, -s SKIPLIST
list of dirs to skip [default: [.git vendor]]
--vendor check files in vendor directory
--files read file names from stdin one at each line
--exclude EXCLUDE, -e EXCLUDE
exclude lines that matches this regex
--help, -h display this help and exit
```Example usage to check only go files for lines more than 100 characters.
Excluding lines that contain the words TODO or FIXME.
`lll -l 100 -g -e "TODO|FIXME" path/to/myproject`.You can also define the flags using environment variables, eg.
`MAXLENGTH=100 GOONLY=true lll path/to/my/project`.## Testing
Use the `go test` tool.
```shell
$ go test -cover
```## Contributing
All contributions are welcome! See [CONTRIBUTING](CONTRIBUTING.md) for more
info.## License
The code is under the MIT license. See [LICENSE](LICENSE) for more
information.