forked from ipetkov/crane
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- Co-authored-by: Ivan Petkov <[email protected]>
- Loading branch information
1 parent
6339656
commit 96fd12c
Showing
13 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,13 @@ | ||
# Sorts `Cargo.toml` dependencies. All other `.toml` files are formatted with the default config. | ||
# | ||
# https://taplo.tamasfe.dev/configuration/file.html#configuration-file | ||
|
||
[formatting] | ||
reorder_keys = false | ||
|
||
[[rule]] | ||
include = ["**/Cargo.toml"] | ||
keys = ["dependencies"] | ||
|
||
[rule.formatting] | ||
reorder_keys = true |
This file contains 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,4 +1,2 @@ | ||
[licenses] | ||
allow = [ | ||
"MIT" | ||
] | ||
allow = ["MIT"] |
This file contains 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 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,13 @@ | ||
# Sorts `Cargo.toml` dependencies. All other `.toml` files are formatted with the default config. | ||
# | ||
# https://taplo.tamasfe.dev/configuration/file.html#configuration-file | ||
|
||
[formatting] | ||
reorder_keys = false | ||
|
||
[[rule]] | ||
include = ["**/Cargo.toml"] | ||
keys = ["dependencies"] | ||
|
||
[rule.formatting] | ||
reorder_keys = true |
This file contains 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 |
---|---|---|
|
@@ -161,6 +161,7 @@ | |
mdbook | ||
nix-eval-jobs | ||
nixpkgs-fmt | ||
taplo | ||
]; | ||
}; | ||
}); | ||
|
This file contains 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 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,24 @@ | ||
{ taplo | ||
, mkCargoDerivation | ||
}: | ||
|
||
{ taploExtraArgs ? "" | ||
, ... | ||
}@origArgs: | ||
let | ||
args = builtins.removeAttrs origArgs [ "taploExtraArgs" ]; | ||
in | ||
mkCargoDerivation (args // { | ||
cargoArtifacts = null; | ||
cargoVendorDir = null; | ||
pnameSuffix = "-tomlfmt"; | ||
|
||
buildPhaseCargoCommand = "taplo fmt --check ${taploExtraArgs}"; | ||
|
||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ taplo ]; | ||
|
||
preInstallPhases = [ "ensureTargetDir" ] ++ (args.preInstallPhases or [ ]); | ||
ensureTargetDir = '' | ||
mkdir -p ''${CARGO_TARGET_DIR:-target} | ||
''; | ||
}) |