Repository navigation
fix: silence recurring 'drupol' error - #513
Merged
Merged
Conversation
drupol
approved these changes
May 11, 2026
charlesfire
pushed a commit
to charlesfire/den
that referenced
this pull request
May 16, 2026
## Summary
Replaces 21 bare `if/then/else` sites across 13 files with their
idiomatic `lib.optional`, `lib.optionals`, and `lib.optionalAttrs`
equivalents.
This PR eliminates a persistent source of review noise — every PR
touching these files triggers the same nit from a certain vigilant
reviewer. We figured it was cheaper to fix all 21 sites at once than to
mass-produce "will fix in follow-up" comments for the rest of eternity.
## Changes
- 10 × `if cond then [ x ] else [ ]` → `lib.optional`
- 5 × `if cond then [ ... ] else [ ]` → `lib.optionals`
- 6 × `if cond then { ... } else { }` → `lib.optionalAttrs`
- Added `lib` to the parameter set of `bind.nix`, `unfree.nix`, and
`insecure.nix` where it wasn't previously in scope
Net: **-42 lines**. Zero semantic changes. 771/771 tests pass.
## Test plan
- [x] `just ci` — 771/771 green
- [x] `just fmt` — no diff
- [x] drupol mass-nit surface area reduced to zero (until we write more
`if`s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces 21 bare
if/then/elsesites across 13 files with their idiomaticlib.optional,lib.optionals, andlib.optionalAttrsequivalents.This PR eliminates a persistent source of review noise — every PR touching these files triggers the same nit from a certain vigilant reviewer. We figured it was cheaper to fix all 21 sites at once than to mass-produce "will fix in follow-up" comments for the rest of eternity.
Changes
if cond then [ x ] else [ ]→lib.optionalif cond then [ ... ] else [ ]→lib.optionalsif cond then { ... } else { }→lib.optionalAttrslibto the parameter set ofbind.nix,unfree.nix, andinsecure.nixwhere it wasn't previously in scopeNet: -42 lines. Zero semantic changes. 771/771 tests pass.
Test plan
just ci— 771/771 greenjust fmt— no diffifs)