Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions flake.lock

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

18 changes: 15 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
# TODO: https://github.com/cachix/pre-commit-hooks.nix/pull/396
# url = "github:cachix/pre-commit-hooks.nix";
url = "github:mrcjkb/pre-commit-hooks.nix/clippy";
inputs.nixpkgs.follows = "nixpkgs";
};
};
Expand Down Expand Up @@ -44,8 +46,18 @@
hooks = {
alejandra.enable = true;
rustfmt.enable = true;
# clippy.enable = true;
# cargo-check.enable = true;
clippy.enable = true;
cargo-check.enable = true;
};
settings = {
runtimeDeps = pkgs.rocks.buildInputs ++ pkgs.rocks.nativeBuildInputs;
rust.cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
clippy = {
denyWarnings = true;
allFeatures = true;
};
};
};
in {
Expand Down
2 changes: 1 addition & 1 deletion rocks-bin/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub async fn search(data: Search, config: &Config) -> Result<()> {

if data.porcelain {
versions.for_each(|version| {
println!("{} {} {} {}", key, version, "src|rockspec", config.server)
println!("{} {} src|rockspec {}", key, version, config.server)
});
} else {
let mut tree = StringTreeNode::new(key.to_owned());
Expand Down
6 changes: 4 additions & 2 deletions rocks-lib/src/manifest/pull_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ mod tests {
let server = start_test_server("manifest-5.1".into());
let mut url_str = server.url_str(""); // Remove trailing "/"
url_str.pop();
let mut config = Config::default();

config.lua_version = Some("5.1".into());
let config = Config {
lua_version: Some("5.1".into()),
..Config::default()
};

manifest_from_server(url_str, &config).await.unwrap();
}
Expand Down
9 changes: 4 additions & 5 deletions rocks-lib/src/rockspec/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,13 @@ mod tests {

#[tokio::test]
pub async fn deserialize_build_type() {
let build_type: BuildType = serde_json::from_str("\"builtin\"".into()).unwrap();
let build_type: BuildType = serde_json::from_str("\"builtin\"").unwrap();
assert_eq!(build_type, BuildType::Builtin);
let build_type: BuildType = serde_json::from_str("\"module\"".into()).unwrap();
let build_type: BuildType = serde_json::from_str("\"module\"").unwrap();
assert_eq!(build_type, BuildType::Builtin);
let build_type: BuildType = serde_json::from_str("\"make\"".into()).unwrap();
let build_type: BuildType = serde_json::from_str("\"make\"").unwrap();
assert_eq!(build_type, BuildType::Make);
let build_type: BuildType =
serde_json::from_str("\"luarocks_build_rust_mlua\"".into()).unwrap();
let build_type: BuildType = serde_json::from_str("\"luarocks_build_rust_mlua\"").unwrap();
assert_eq!(
build_type,
BuildType::LuaRock("luarocks_build_rust_mlua".into())
Expand Down
6 changes: 3 additions & 3 deletions rocks-lib/src/rockspec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ mod tests {
per_platform
.get(&PlatformIdentifier::Windows)
.unwrap()
.into_iter()
.iter()
.filter(|dep| dep.matches(&neorg_override)
|| dep.matches(&toml_edit)
|| dep.matches(&toml))
Expand All @@ -603,7 +603,7 @@ mod tests {
per_platform
.get(&PlatformIdentifier::Unix)
.unwrap()
.into_iter()
.iter()
.filter(|dep| dep.matches(&neorg_override)
|| dep.matches(&toml_edit)
|| dep.matches(&toml))
Expand All @@ -614,7 +614,7 @@ mod tests {
per_platform
.get(&PlatformIdentifier::Linux)
.unwrap()
.into_iter()
.iter()
.filter(|dep| dep.matches(&neorg_override)
|| dep.matches(&toml_edit)
|| dep.matches(&toml))
Expand Down