Skip to content

Commit db3c0b0

Browse files
committed
style: Remove dead code and underscore unused parameters
Follow lint suggestions.
1 parent 5c0c205 commit db3c0b0

18 files changed

+17
-47
lines changed

flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
inputs.elisp-helpers.url = "github:emacs-twist/elisp-helpers";
55

6-
outputs = {...} @ inputs: {
6+
outputs = inputs: {
77
# The APIs under lib is unstable at present. It may undergo changes in the
88
# future.
99
lib = import ./lib inputs;

lib/default.nix

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ in
2727

2828
emacsBuiltinLibraries =
2929
{
30-
stdenv,
31-
ripgrep,
32-
emacs,
3330
lib,
3431
}@args:
3532
lib.pipe (readFile (import ../pkgs/emacs/builtins.nix args)) [

modules/home-manager.nix

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ home-manager module that provides an installation of Emacs
1212

1313
emacs-config = cfg.config;
1414

15-
configurationRevision = emacs-config.configurationRevision;
16-
1715
initFile = pkgs.runCommandLocal "init.el" {} ''
1816
mkdir -p $out
1917
touch $out/init.el
@@ -45,7 +43,7 @@ home-manager module that provides an installation of Emacs
4543
'';
4644

4745
desktopItem = pkgs.makeDesktopItem {
48-
name = cfg.name;
46+
inherit (cfg) name;
4947
inherit (cfg.desktopItem) desktopName mimeTypes;
5048
comment = "Edit text";
5149
genericName = "Text Editor";

pkgs/build-support/elisp/collectFromSetup.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ with builtins; let
33
go = {
44
data,
55
rest,
6-
} @ acc: fields: {
6+
}: fields: {
77
data =
88
data
99
++ lib.pipe fields [

pkgs/build-support/elisp/flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
inputs.elisp-helpers.url = "github:emacs-twist/elisp-helpers";
33

44
outputs =
5-
{ ... }:
5+
_:
66
{
77
};
88
}

pkgs/build-support/testToNix.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ in
2121
type = "github";
2222
};
2323
};
24-
outputs = {...}: {};
24+
outputs = _: {};
2525
};
2626
expected = ''
2727
{ description = "description"; inputs = { bind-key = { flake = false; owner = "jwiegley"; repo = "use-package"; type = "github"; }; "bind-key+" = { flake = false; owner = "jwiegley"; repo = "use-package"; type = "github"; }; }; outputs = <LAMBDA>; }'';

pkgs/build-support/toNix.nix

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
{lib}: let
55
inherit (builtins) isList isAttrs isFunction toJSON concatStringsSep match;
66

7-
isPrimitive = v: ! (isList v || isAttrs v || isFunction v);
8-
97
wrap = open: close: body: open + body + close;
108

119
printList = v:

pkgs/emacs/data/default.nix

-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ let
66
tail
77
hasAttr
88
filter
9-
elem
109
mapAttrs
11-
readFile
1210
pathExists
13-
concatLists
1411
isFunction
1512
removeAttrs
1613
attrNames

pkgs/emacs/data/inventory/elpa.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ with builtins;
2727
lib.pipe elpaEntries [
2828
(lib.filterAttrs (_: entry: entry ? core))
2929
(lib.mapAttrs (
30-
_: {core, ...} @ entry: {
30+
_: {core, ...}: {
3131
inherit inventory;
3232
src = args.core-src;
3333
doTangle = true;

pkgs/emacs/data/package.nix

+2-13
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@ let
22
inherit
33
(builtins)
44
pathExists
5-
fetchTree
6-
replaceStrings
7-
map
8-
readDir
95
hasAttr
106
readFile
117
attrNames
128
filter
13-
all
149
match
15-
isString
16-
isList
17-
typeOf
1810
length
1911
head
2012
toJSON
@@ -120,10 +112,7 @@ in
120112
];
121113

122114
mainFile =
123-
if attrs ? mainFile
124-
then attrs.mainFile
125-
else
126-
lib.findFirst
115+
attrs.mainFile or (lib.findFirst
127116
(file: baseNameOf file == ename + ".el")
128117
(
129118
if length self.lispFiles > 0
@@ -136,7 +125,7 @@ in
136125
Entry: ${toJSON attrs.inventory}
137126
''
138127
)
139-
self.lispFiles;
128+
self.lispFiles);
140129

141130
# TODO: Check https://github.com/melpa/melpa/issues/2955 on the right versioning scheme
142131
version =

pkgs/emacs/default.nix

-3
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@
5454
(builtins)
5555
readFile
5656
attrNames
57-
attrValues
5857
concatLists
5958
isFunction
6059
split
6160
filter
6261
isString
6362
mapAttrs
64-
match
65-
isList
6663
isAttrs
6764
elem
6865
removeAttrs

pkgs/emacs/lock/default.nix

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
{
22
lib,
3-
nix,
43
nixfmt-rfc-style,
54
jq,
65
coreutils,
76
runCommandLocal,
8-
writeTextFile,
97
writeShellScript,
108
writeShellApplication,
119
# Current version
12-
flakeLockFile ? null,
1310
}: {
1411
packageInputs,
1512
flakeNix ? false,
@@ -19,7 +16,7 @@
1916
postCommand ? null,
2017
}:
2118
assert (flakeNix || archiveLock); let
22-
inherit (builtins) toJSON attrNames mapAttrs;
19+
inherit (builtins) toJSON mapAttrs;
2320

2421
archiveLockData = lib.pipe packageInputs [
2522
(lib.filterAttrs (_: attrs: attrs ? archive))
@@ -50,7 +47,7 @@ assert (flakeNix || archiveLock); let
5047
(lib.filterAttrs (_: attrs: attrs ? origin))
5148
(lib.mapAttrs (_: {origin, ...}: origin // {flake = false;}))
5249
];
53-
outputs = {...}: {};
50+
outputs = _: {};
5451
};
5552
archiveLock = toJSON archiveLockData;
5653
metadataJson = toJSON packageMetadata;

pkgs/emacs/tools/check-versions.nix

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
inherit
1010
(builtins)
1111
mapAttrs
12-
all
1312
hasAttr
1413
elem
1514
length
@@ -18,7 +17,6 @@
1817
substring
1918
lessThan
2019
concatLists
21-
sort
2220
concatStringsSep
2321
attrNames
2422
;
@@ -90,9 +88,9 @@
9088
}
9189
// status)))
9290
concatLists
93-
(lib.groupBy ({ename, ...}: ename))
94-
(mapAttrs (ename: statuses: {
95-
current = (head statuses).current;
91+
(builtins.groupBy ({ename, ...}: ename))
92+
(mapAttrs (_ename: statuses: {
93+
inherit ((head statuses)) current;
9694
# Showing the source date may be useful, but maybe later.
9795
#
9896
# lastModifiedDate =

pkgs/emacs/tools/reverse.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Reverse dependencies of elisp packages
22
{lib}: packageInputs: let
3-
inherit (builtins) attrNames hasAttr mapAttrs substring;
3+
inherit (builtins) mapAttrs substring;
44

55
revDeps = name:
66
lib.concatMapAttrs (

pkgs/emacs/wrapper.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
configurationRevision,
1616
extraSiteStartElisp,
1717
}: let
18-
inherit (builtins) length listToAttrs;
18+
inherit (builtins) length;
1919

2020
elispInputs = lib.attrVals packageNames elispPackages;
2121

template/flake.nix

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
};
3232

3333
outputs = {
34-
self,
3534
nixpkgs,
3635
nixpkgs-emacs,
3736
flake-utils,

test/flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import nixpkgs {
5151
inherit system;
5252
overlays = [
53-
(final: prev: {
53+
(_final: _prev: {
5454
emacsPackage = emacs-ci.packages.${system}.emacs-snapshot;
5555
})
5656
];

test/lock/flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@
104104
type = "github";
105105
};
106106
};
107-
outputs = { ... }: { };
107+
outputs = _: { };
108108
}

0 commit comments

Comments
 (0)