Skip to content
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

feats: devenv / update deps / clean clippy / dependabot / drop useless submodule #134

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export DIRENV_WARN_TIMEOUT=20s

eval "$(devenv direnvrc)"

use devenv
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
Cargo.lock
target/

# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "crossbeam"]
path = crossbeam
url = https://github.com/crossbeam-rs/crossbeam.git
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ default = ["std"]
std = []

[dev-dependencies]
rand = "0.8"
criterion = "0.3"
# TODO: This is only needed for the doctests of cache_padded.rs! Is there a way to avoid this?
crossbeam-utils = { version = "0.8", default-features = false }
rand = "0.9.0"
criterion = "0.5.1"

# aggressive optimization for benchmarks
[profile.bench]
Expand Down
63 changes: 63 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Justfile

# By default, run a full check (check)
default: check

# Full check: fmt (format check), clippy, tests
check:
@echo "==> Checking format..."
cargo fmt --all -- --check

@echo "==> Checking clippy..."
cargo clippy --all-targets --all-features -- -D warnings

@echo "==> Running tests with nextest..."
cargo nextest run --workspace --all-features

@echo "==> Running audit..."
cargo audit

@echo "==> Checking outdated dependencies..."
cargo outdated

@echo "All checks passed!"

# Code formatting
fmt:
@echo "==> Formatting code..."
cargo fmt --all

# Running Clippy
clippy:
@echo "==> Clippy linting..."
cargo clippy --all-targets --all-features -- -D warnings

# Running tests (nextest)
test:
@echo "==> Running tests (debug)..."
cargo nextest run --workspace --all-features

# Running tests in release build
test-release:
@echo "==> Running tests (release)..."
cargo nextest run --workspace --all-features --release

# Generating (and opening) documentation
doc:
@echo "==> Building docs..."
cargo doc --no-deps --all-features --open

# Checking for outdated dependencies
outdated:
@echo "==> Checking outdated dependencies..."
cargo outdated

# Updating dependencies
update:
@echo "==> Updating dependencies..."
cargo update

# Checking dependencies for vulnerabilities
audit:
@echo "==> Auditing dependencies..."
cargo audit
1 change: 0 additions & 1 deletion crossbeam
Submodule crossbeam deleted from 00283f
140 changes: 140 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1738414267,
"owner": "cachix",
"repo": "devenv",
"rev": "3f49b4afbb9a80b1e81fb6071f59dac152177efa",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1738650687,
"owner": "nix-community",
"repo": "fenix",
"rev": "37a1f29ebf98fbbac667730edc5dab4ebe2e3954",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1737465171,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1738703096,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f7384aacd0ecd28681a99269ac0dff2c3a805d63",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"fenix": "fenix",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1738698211,
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "6fb64beb807b07dc687fd0f00261c7c404a83947",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
27 changes: 27 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/packages/
packages = [
pkgs.curl
pkgs.git
pkgs.jq
pkgs.rustup
pkgs.sccache
pkgs.cargo-outdated
pkgs.cargo-nextest
pkgs.cargo-audit
pkgs.just
pkgs.tree
] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
frameworks.SystemConfiguration
frameworks.Security
frameworks.CoreFoundation
]);

# https://devenv.sh/languages/
languages.nix.enable = true;
languages.rust.enable = true;

env.RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache";
}
9 changes: 9 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
fenix:
url: github:nix-community/fenix
inputs:
nixpkgs:
follows: nixpkgs
1 change: 0 additions & 1 deletion src/cache_padded.rs

This file was deleted.

Loading