Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Fix pre-commit hooks (#252)
Browse files Browse the repository at this point in the history
- Remove python project
- Remove license header precommit hooks
- Update flake.lock
- Run cargo-sort
  • Loading branch information
sveitser authored Aug 23, 2024
1 parent 3154544 commit 2b5062b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 162 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ clap = { version = "4.5", features = ["derive", "env"] }
committable = "0.2"
derivative = "2.2"
futures = "0.3"
hex = "0.4.3"
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.42" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
lru = "0.12.3"
serde = { version = "1.0", features = ["derive"] }
sha2 = "0.10"
snafu = "0.8"
Expand All @@ -31,8 +33,6 @@ tide-disco = "0.9"
tokio = "1"
tracing = "0.1"
vbs = "0.1"
lru = "0.12.3"
hex = "0.4.3"

[dev-dependencies]
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
Expand Down
132 changes: 9 additions & 123 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 2 additions & 37 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@
inputs.pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";

inputs.poetry2nixFlake = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, poetry2nixFlake, ... }:
outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
poetry2nix = poetry2nixFlake.lib.mkPoetry2Nix { inherit pkgs; };
rustToolchain = pkgs.rust-bin.stable.latest.minimal.override {
extensions = [ "rustfmt" "clippy" "llvm-tools-preview" "rust-src" ];
};
Expand Down Expand Up @@ -96,8 +90,6 @@
license = with licenses; [ mit asl20 ];
};
};
pythonEnv = poetry2nix.mkPoetryEnv { projectDir = ./.; };
myPython = with pkgs; [ poetry pythonEnv ];
shellHook = ''
# Prevent cargo aliases from using programs in `~/.cargo` to avoid conflicts with rustup
# installations.
Expand Down Expand Up @@ -132,33 +124,6 @@
entry = "cargo clippy --workspace --all-features --all-targets -- -D clippy::dbg-macro";
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.txt --comment-style "//"'';
types_or = [ "rust" ];
pass_filenames = true;
};
license-header-hash = {
enable = true;
description =
"Ensure files with hash style comments have license header";
entry = ''
insert_license --license-filepath .license-header.txt --comment-style "#"'';
types_or = [ "bash" "python" "toml" "nix" ];
excludes = [ "poetry.lock" ];
pass_filenames = true;
};
license-header-html = {
enable = true;
description = "Ensure markdown files have license header";
entry = ''
insert_license --license-filepath .license-header.txt --comment-style "<!--| ~| -->"'';
types_or = [ "markdown" ];
pass_filenames = true;
};
};
};
};
Expand All @@ -175,7 +140,7 @@
mdbook # make-doc, documentation generation
protobuf
rustToolchain
] ++ myPython ++ rustDeps;
] ++ rustDeps;

inherit RUST_SRC_PATH RUST_BACKTRACE RUST_LOG RUSTFLAGS;
};
Expand Down

0 comments on commit 2b5062b

Please sign in to comment.