From 21775f28cd1bdde8eddd84a508813b01d620db89 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 4 Dec 2021 13:02:57 +0530 Subject: new lint: empty_inherit --- bin/tests/data/empty_inherit.nix | 3 +++ bin/tests/snapshots/main__empty_inherit.snap | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 bin/tests/data/empty_inherit.nix create mode 100644 bin/tests/snapshots/main__empty_inherit.snap (limited to 'bin') diff --git a/bin/tests/data/empty_inherit.nix b/bin/tests/data/empty_inherit.nix new file mode 100644 index 0000000..dc31afc --- /dev/null +++ b/bin/tests/data/empty_inherit.nix @@ -0,0 +1,3 @@ +{ + inherit; +} diff --git a/bin/tests/snapshots/main__empty_inherit.snap b/bin/tests/snapshots/main__empty_inherit.snap new file mode 100644 index 0000000..1d91e0a --- /dev/null +++ b/bin/tests/snapshots/main__empty_inherit.snap @@ -0,0 +1,13 @@ +--- +source: bin/tests/main.rs +expression: "&out" + +--- +[W14] Warning: Found empty inherit statement + ╭─[data/empty_inherit.nix:2:3] + │ + 2 │ inherit; + · ────┬─── + · ╰───── Remove this empty inherit statement +───╯ + -- cgit v1.2.3