Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/synthetica9/nix-linter

Linter for the Nix expression language
https://github.com/synthetica9/nix-linter

haskell linter nix nixpkgs

Last synced: 26 days ago
JSON representation

Linter for the Nix expression language

Awesome Lists containing this project

README

        

# `nix-linter`

[![Build Status](https://travis-ci.org/Synthetica9/nix-linter.svg?branch=master)](https://travis-ci.org/Synthetica9/nix-linter)

`nix-linter` is a program to check for several common mistakes or stylistic
errors in Nix expressions, such as unused arguments, empty let blocks,
etcetera.

## Usage

First, setup cachix:

```sh
cachix use nix-linter
```

Then clone the repo and `cd` into it:

```sh
git clone https://github.com/Synthetica9/nix-linter
cd nix-linter
```

Finally, you can run the application with:

```sh
$(nix-build -A nix-linter)/bin/nix-linter --help

```

```
The nix-linter program

nix-linter [OPTIONS] [FILES]

Common flags:
-W --check=ITEM checks to enable
-j --json Use JSON output
-J --json-stream Use a newline-delimited stream of JSON objects
instead of a JSON list (implies --json)
-r --recursive Recursively walk given directories (like find)
-o --out[=FILE] File to output to
-h --help-for=CHECKS
-? --help Display help message
-V --version Print version information
-v --verbose Loud verbosity
-q --quiet Quiet verbosity

Available checks (See `nix-linter --help-for [CHECK]` for more details):
DIYInherit
EmptyInherit
EmptyLet
EtaReduce
FreeLetInFunc
LetInInheritRecset
ListLiteralConcat
NegateAtom
SequentialLet
SetLiteralUpdate
UnfortunateArgName
UnneededRec
UnusedArg
UnusedLetBind
UpdateEmptySet
AlphabeticalArgs (disabled by default)
AlphabeticalBindings (disabled by default)
BetaReduction (disabled by default)
EmptyVariadicParamSet (disabled by default)
UnneededAntiquote (disabled by default)

```