-
Notifications
You must be signed in to change notification settings - Fork 89
feat: Auto-format Nix files using Alejandra #172
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
Open
l0b0
wants to merge
5
commits into
cachix:master
Choose a base branch
from
l0b0:feat/alejandra
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3d81dbf
refactor: Format files using Prettier
l0b0 5f41732
feat: Enable automatically formatting code using pre-commit
l0b0 e816083
feat: Check formatting as part of CI
l0b0 f4aefd4
refactor: Format Nix file using Alejandra
l0b0 fda244e
feat: Auto-format Nix files using Alejandra
l0b0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| version: 2 | ||
| updates: | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| schedule: | ||
| interval: daily | ||
| time: '00:00' | ||
| timezone: UTC | ||
| open-pull-requests-limit: 10 | ||
| commit-message: | ||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| schedule: | ||
| interval: daily | ||
| time: "00:00" | ||
| timezone: UTC | ||
| open-pull-requests-limit: 10 | ||
| commit-message: | ||
| prefix: "chore" | ||
| include: "scope" | ||
| include: "scope" |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Configuration file for pre-commit (https://pre-commit.com/). | ||
| # Please run `pre-commit run --all-files` when adding or changing entries. | ||
|
|
||
| repos: | ||
| - repo: https://github.com/kamadorueda/alejandra | ||
| rev: bb7f2ad3f176aa8e9e2944a10061f7989c8fef17 # frozen: 1.3.0 | ||
| hooks: | ||
| - id: alejandra | ||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-prettier | ||
| rev: 6f3cb139ef36133b6f903b97facc57b07cef57c9 # frozen: v3.0.0-alpha.6 | ||
| hooks: | ||
| - id: prettier | ||
| stages: [commit] |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| # Realizes <num>> of derivations with size of <size>MB | ||
| { size ? 1 # MB | ||
| , num ? 10 # count | ||
| , currentTime ? builtins.currentTime | ||
| , noChroot ? false | ||
| { | ||
| size ? 1, # MB | ||
| num ? 10, # count | ||
| currentTime ? builtins.currentTime, | ||
| noChroot ? false, | ||
| }: | ||
|
|
||
| with import <nixpkgs> {}; | ||
|
|
||
| let | ||
| drv = i: runCommand "${toString currentTime}-${toString i}" { | ||
| __noChroot = noChroot; | ||
| } '' | ||
| dd if=/dev/zero of=$out bs=${toString size}MB count=1 | ||
| ''; | ||
| in writeText "empty-${toString num}-${toString size}MB" '' | ||
| ${lib.concatMapStringsSep "" drv (lib.range 1 num)} | ||
| '' | ||
| with import <nixpkgs> {}; let | ||
| drv = i: | ||
| runCommand "${toString currentTime}-${toString i}" { | ||
| __noChroot = noChroot; | ||
| } '' | ||
| dd if=/dev/zero of=$out bs=${toString size}MB count=1 | ||
| ''; | ||
| in | ||
| writeText "empty-${toString num}-${toString size}MB" '' | ||
| ${lib.concatMapStringsSep "" drv (lib.range 1 num)} | ||
| '' |
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.
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.
#21
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.
It's been a while. Do you have some more detail, or is this no longer relevant?