[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode d0eb92e97a 263/500: Package linting
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode d0eb92e97a 263/500: Package linting |
Date: |
Sat, 29 Jan 2022 08:27:12 -0500 (EST) |
branch: elpa/nix-mode
commit d0eb92e97a4ea4196355922902b8e93b8ac221b4
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Package linting
Some various cleanups from flycheck.
---
nix-instantiate.el | 14 +++++++++-----
nix-log.el | 4 +++-
nix-shell.el | 4 +++-
nix-store.el | 2 +-
nix.el | 3 ++-
5 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/nix-instantiate.el b/nix-instantiate.el
index 05607b4629..899ec9790b 100644
--- a/nix-instantiate.el
+++ b/nix-instantiate.el
@@ -23,17 +23,20 @@ DRV file to load from."
(setq result
(cdar (with-current-buffer stdout
(when (eq (buffer-size) 0)
- (error "nix show-derivation %s failed to produce any output"
+ (error "Nix’s show-derivation %s failed to produce any
output"
drv))
(goto-char (point-min))
(json-read))))
(kill-buffer stdout)
result))
-(defun nix-instantiate (nix-file &optional attribute)
+(defun nix-instantiate (nix-file &optional attribute parse)
"Run nix-instantiate on a Nix expression.
NIX-FILE the file to instantiate.
-ATTRIBUTE an attribute of the Nix file to use."
+ATTRIBUTE an attribute of the Nix file to use.
+PARSE whether to parse nix-instantiate output."
+ (interactive (list (read-file-name "Nix file: ") nil t))
+
(let ((stdout (generate-new-buffer "nix-instantiate"))
result)
(if attribute
@@ -46,8 +49,9 @@ ATTRIBUTE an attribute of the Nix file to use."
(error
"Error: nix-instantiate %s failed to produce any output"
nix-file))
- (setq result (nix-instantiate--parsed
- (substring (buffer-string) 0 (- (buffer-size) 1)))))
+ (setq result (substring (buffer-string) 0 (- (buffer-size) 1)))
+ (when parse
+ (setq result (nix-instantiate--parsed result))))
(kill-buffer stdout)
result))
diff --git a/nix-log.el b/nix-log.el
index 8a9b40b7e5..192ab3170e 100644
--- a/nix-log.el
+++ b/nix-log.el
@@ -15,7 +15,9 @@
(require 'nix-instantiate)
(defun nix-log (file attr)
- "Open the nix log."
+ "Open the nix log.
+FILE nix file to parse.
+ATTR attribute to load the log of."
(interactive (list (nix-read-file) nil))
(unless attr (setq attr (nix-read-attr file)))
diff --git a/nix-shell.el b/nix-shell.el
index 61420a0bad..e0307c02c3 100644
--- a/nix-shell.el
+++ b/nix-shell.el
@@ -106,6 +106,8 @@ ATTR from NIX-FILE to get Nix expressions from."
nix-shell-executable
file attr phase phase phase)))
+(declare-function flycheck-buffer "flycheck")
+
(defun nix-shell--callback (buffer drv)
"Run the nix-shell callback to setup the buffer.
The BUFFER to run in.
@@ -178,7 +180,7 @@ PKGS-FILE package set to pull from."
(insert (format "with import %s { };\n" pkgs-file))
(insert "runCommandCC \"shell\" {\n")
(insert " nativeBuildInputs = [\n")
- (mapcar (lambda (x) (insert (format " %s\n" x))) packages)
+ (mapc (lambda (x) (insert (format " %s\n" x))) packages)
(insert " ];\n")
(insert "} \"\"\n"))
nix-file))
diff --git a/nix-store.el b/nix-store.el
index c702f388d0..eeaecbb453 100644
--- a/nix-store.el
+++ b/nix-store.el
@@ -1,4 +1,4 @@
-;;; nix.el -- run nix commands in Emacs -*- lexical-binding: t -*-
+;;; nix-store.el -- run nix commands in Emacs -*- lexical-binding: t -*-
;; Author: Matthew Bauer <mjbauer95@gmail.com>
;; Homepage: https://github.com/NixOS/nix-mode
diff --git a/nix.el b/nix.el
index e4961ba2db..3261e075b4 100644
--- a/nix.el
+++ b/nix.el
@@ -153,7 +153,8 @@
"trusted-users"))
(defun nix--pcomplete-flags (options)
- "Complete flags to the Nix command."
+ "Complete flags to the Nix command.
+OPTIONS a list of options to accept."
(while (pcomplete-match "^-" 0)
(pcomplete-here options)
(let ((last-arg (nth (1- pcomplete-index) pcomplete-args)))
- [nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from purcell/master, (continued)
- [nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from purcell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1b3424ade0 190/500: Don't ignore errors when loading nix-format / nix-shebang, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 93a59d9acb 179/500: Use cl-lib instead of cl., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7c732faf3a 183/500: Handle smartparens in nix-mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7716e6d1e4 208/500: fix (cond) usage, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 236318101e 217/500: Cleanup global-nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 857d963d1e 219/500: Add nix-system function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 58325164ca 232/500: Update README.md, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 36070654c8 243/500: Don’t autoload nix-instantiate., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d2f4a629a8 258/500: Only show derivations in nix store, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d0eb92e97a 263/500: Package linting,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 38061187ca 265/500: Add nix-read-file & nix-read-attr, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7d65288c72 266/500: Fix erroneous use of function as variable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 8b3a9927e7 270/500: Add dependency on json-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7a7f600133 288/500: travis: Add travis badge, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode da16900326 293/500: tests: Add a testcase with broken identation to have as a check if it indents at all, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aa43b72a45 014/500: Revert "Use warning font lock for upper case vars", ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a2674592f 033/500: Don't save-excursion for nix-indent-line., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 233bf03b96 040/500: Add nixfmt command., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff550f9bbd 036/500: Add comments., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ea95e3c9c6 068/500: Add nix-prettify-mode.el., ELPA Syncer, 2022/01/29