-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
374 additions
and
426 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Copyright (c) 2022 Espresso Systems (espressosys.com) | ||
This file is part of the Jellyfish library. | ||
|
||
You should have received a copy of the MIT License | ||
along with the Jellyfish library. If not, see <https://mit-license.org/>. |
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,8 +1,8 @@ | ||
[workspace] | ||
members = [ | ||
"plonk", | ||
"relation", | ||
"primitives", | ||
"relation", | ||
"utilities", | ||
"utilities_derive", | ||
] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,98 @@ | ||
# Copyright (c) 2022 Espresso Systems (espressosys.com) | ||
# This file is part of the Jellyfish library. | ||
|
||
# You should have received a copy of the MIT License | ||
# along with the Jellyfish library. If not, see <https://mit-license.org/>. | ||
|
||
{ | ||
description = "Jellyfish dev env"; | ||
|
||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; # for dedup | ||
|
||
# allow shell.nix alongside flake.nix | ||
inputs.flake-compat.url = "github:edolstra/flake-compat"; | ||
inputs.flake-compat.flake = false; | ||
|
||
inputs.rust-overlay.url = "github:oxalica/rust-overlay"; | ||
inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; | ||
|
||
outputs = { self, nixpkgs, flake-utils, flake-compat, rust-overlay, pre-commit-hooks, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
overlays = [ (import rust-overlay) ]; | ||
pkgs = import nixpkgs { inherit system overlays; }; | ||
nightlyToolchain = pkgs.rust-bin.selectLatestNightlyWith | ||
(toolchain: toolchain.minimal.override { extensions = [ "rustfmt" ]; }); | ||
|
||
stableToolchain = pkgs.rust-bin.stable.latest.minimal.override { | ||
extensions = [ "clippy" "llvm-tools-preview" "rust-src" ]; | ||
}; | ||
in with pkgs; | ||
{ | ||
check = { | ||
pre-commit-check = pre-commit-hooks.lib.${system}.run { | ||
src = ./.; | ||
hooks = { | ||
check-format = { | ||
enable = true; | ||
files = "\\.rs$"; | ||
entry = "cargo fmt -- --check"; | ||
}; | ||
doctest = { | ||
enable = true; | ||
entry = "cargo test --doc"; | ||
files = "\\.rs$"; | ||
pass_filenames = false; | ||
}; | ||
cargo-clippy = { | ||
enable = true; | ||
description = "Lint Rust code."; | ||
entry = "cargo-clippy --workspace -- -D warnings"; | ||
files = "\\.rs$"; | ||
pass_filenames = false; | ||
}; | ||
cargo-sort = { | ||
enable = true; | ||
description = "Ensure Cargo.toml are sorted"; | ||
entry = "cargo sort -w"; | ||
pass_filenames = false; | ||
}; | ||
license-header-c-style = { | ||
enable = true; | ||
description = | ||
"Ensure files with c-style comments have license header"; | ||
entry = '' | ||
insert_license --license-filepath .license-header --comment-style "//"''; | ||
types_or = [ "rust" ]; | ||
pass_filenames = true; | ||
}; | ||
}; | ||
}; | ||
}; | ||
devShell = mkShell { | ||
buildInputs = [ | ||
argbash | ||
openssl | ||
pkgconfig | ||
git | ||
|
||
stableToolchain | ||
nightlyToolchain | ||
cargo-sort | ||
|
||
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; | ||
|
||
shellHook = '' | ||
export RUST_BACKTRACE=full | ||
export PATH="$PATH:$(pwd)/target/debug:$(pwd)/target/release" | ||
# Ensure `cargo fmt` uses `rustfmt` from nightly. | ||
export RUSTFMT="${nightlyToolchain}/bin/rustfmt" | ||
'' | ||
# install pre-commit hooks | ||
+ self.check.${system}.pre-commit-check.shellHook; | ||
}; | ||
} | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.