Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: f4d3b4fb76e6
Choose a base ref
...
head repository: NixOS/nix
compare: 691a1bd7179b
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Jul 26, 2020

  1. libutil/logging: extend internal-json logger to make it more machin…

    …e-readable
    
    The new error-format is pretty nice from a UX point-of-view, however
    it's fairly hard to parse the output e.g. for editor plugins such as
    vim-ale[1] that use `nix-instantiate --parse` to determine syntax errors in
    Nix expression files.
    
    This patch extends the `internal-json` logger by adding the fields
    `line`, `column` and `file` to easily locate an error in a file and the
    field `raw_msg` which contains the error-message itself without
    code-lines and additional helpers.
    
    An exemplary output may look like this:
    
    ```
    [nix-shell]$ ./inst/bin/nix-instantiate ~/test.nix --log-format minimal
    {"action":"msg","column":1,"file":"/home/ma27/test.nix","level":0,"line":4,"raw_msg":"syntax error, unexpected IF, expecting $end","msg":"<full error-msg with code-lines etc>"}
    ```
    
    [1] https://github.com/dense-analysis/ale
    Ma27 committed Jul 26, 2020
    Copy the full SHA
    6ccfdb7 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2020

  1. Copy the full SHA
    691a1bd View commit details
    Browse the repository at this point in the history