Skip to content

NPV 170

Michael Daniels edited this page Apr 5, 2026 · 1 revision

NPV-170: useless escape sequences are not allowed

Description

Some escape sequences are useless; they have no effect. This check prohibits useless escape sequences, as they are generally mistakes.

Error messages

- {file}: line {line}, column {column} contains the escape "{current_escape}".
  This escape has no effect; it is equivalent to "{without_escape}".
  Change it to that.

or

- {file}: line {line}, column {column} contains the escape "{current_escape}".
  This escape has no effect; it is equivalent to "{without_escape}".
  Depending on your intention, either change it to that, or to the non-equivalent "{fixed_escape}".

Example

Given pkgs/by-name/fo/foo/package.nix:

{ someDrv }: builtins.seq "\.*" someDrv

the escape is useless (as it equivalent to ".*"). The error message is:

- pkgs/by-name/fo/foo/package.nix: line 2, column 29 contains the escape "\.".
  This escape has no effect; it is equivalent to ".".
  Depending on your intention, either change it to that, or to the non-equivalent "\\.".
 (https://github.com/NixOS/nixpkgs-vet/wiki/NPV-170)

How to fix

Change the escape sequence to not be useless, or simplify the string to not use an escape sequence.

Clone this wiki locally