-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
treewide: remove no-ops (2) #8065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| [formatter.deadnix] | ||
| command = "deadnix" | ||
| options = [ "--edit", "--no-lambda-arg", "--no-lambda-pattern-names" ] | ||
| options = [ "--edit" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a reason this was added, though. We've done this before and it broke stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. The unit tests succeed at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seeing anything immediately that looks like it would cause issues. Will take a look a bit more later though to see what we had to remedy after last time. I see a commit that changed how we structured args to prevent deadnix from removing an arg again in a99bddf and the rule change was done in 475d357 to handle certain files that were broken from default rules.
modules/lib/booleans.nix
Outdated
| @@ -1,4 +1,4 @@ | |||
| { lib }: | |||
| { ... }: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { ... }: |
| im = config.i18n.inputMethod; | ||
| in | ||
| { | ||
| config = lib.mkIf (im.enable && im.type == "hime") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does deadnix actually remove top level configs by itself now? Interesting..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I did this manually when I came across it.
| { config, pkgs, ... }: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bf893ad Robert Helgesson (2025-07-13 02:53):
tests: re-add module argument
These were removed as part of dead code removal, but they are actually
needed in the integration tests for comparing with the configuration
generated by the installation.
Hunk 1 of 1 @@ -0 +1,2 @@
+{ config, pkgs, ... }:
+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could handle these cases with a # deadnix: skip pragma (documented here).
I just tried to check whether the removal of the lambda pattern lets the test fail, but currently, the fails in both cases.
| { config, pkgs, ... }: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smug.nix 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mbsync/default.nix looks fine. If it passes unit tests, then 👍
|
element-desktop.nix 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for modules/programs/ripgrep-all.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sway/i3 and wlogout LGTM
Description
Inspired by @khaneliman's comment, I lifted all restrictions on
deadnixand formatted the code base accordingly.Also, I removed many redundant
config = { ... }wrappings.Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.