Skip to content

just remembered functions do exist. #18

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

Merged
merged 1 commit into from
Jul 1, 2025
Merged

Conversation

vic
Copy link
Owner

@vic vic commented Jul 1, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 18:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors repeated attribute-update patterns in default.nix by introducing two helper functions and then using them to simplify configuration updates.

  • Introduce accAttr and mergeAttrs helpers to DRY up repeated self (c: …) calls.
  • Refactor accumulating (filter, map, addPath, etc.) and non-accumulating (withLib, pipeTo, leafs) methods to use these helpers.
Comments suppressed due to low confidence (4)

default.nix:102

  • [nitpick] The helper name accAttr is quite terse and may not clearly convey its purpose; consider a more descriptive name like updateAttribute or accumulateAttribute.
            accAttr = attrName: acc: self (c: mapAttr (f c) attrName acc);

default.nix:103

  • [nitpick] The helper name mergeAttrs could be more explicit—names such as mergeWithAttrs or overrideAttributes might better reflect its behavior.
            mergeAttrs = attrs: self (c: (f c) // attrs);

default.nix:102

  • [nitpick] Consider adding a brief comment above accAttr to explain its purpose and usage, which will help future maintainers understand the abstraction.
            accAttr = attrName: acc: self (c: mapAttr (f c) attrName acc);

default.nix:103

  • [nitpick] Adding a short comment for mergeAttrs describing how it merges existing configuration with new attributes would improve readability.
            mergeAttrs = attrs: self (c: (f c) // attrs);

@vic vic merged commit 234b5bb into main Jul 1, 2025
1 check passed
@vic vic deleted the vic/jj-change-zqnyrszupvlw branch July 1, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant