Skip to content

fix: silence recurring 'drupol' error - #513

Merged
sini merged 1 commit into
denful:mainfrom
sini:chore/drupols-drag-race
May 11, 2026
Merged

sini merged 1 commit into
denful:mainfrom
sini:chore/drupols-drag-race

Conversation

@sini

@sini sini commented May 11, 2026

Copy link
Copy Markdown
Collaborator

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

  • just ci — 771/771 green
  • just fmt — no diff
  • drupol mass-nit surface area reduced to zero (until we write more ifs)

@sini
sini requested a review from drupol May 11, 2026 18:51
@sini sini changed the title chore: silence recurring 'drupol' error fix: silence recurring 'drupol' error May 11, 2026
@theutz theutz added the enhancement New feature or request label May 11, 2026
@sini sini added the allow-ci allow all CI integration tests label May 11, 2026
@sini
sini merged commit 042305c into denful:main May 11, 2026
48 of 62 checks passed
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants