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
7 changes: 7 additions & 0 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/float/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ use evm::execute_test_call;
sol!(
#![sol(all_derives)]
DecimalFloat,
"../../out/DecimalFloat.sol/DecimalFloat.json"
env!("RAIN_MATH_FLOAT_DECIMAL_FLOAT_ABI")
);

#[cfg(test)]
sol!(
#![sol(all_derives)]
TestDecimalFloat,
"../../out/TestDecimalFloat.sol/TestDecimalFloat.json"
env!("RAIN_MATH_FLOAT_TEST_DECIMAL_FLOAT_ABI")
);
Comment on lines 24 to 35
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

This touched Rust file also needs the mandatory SPDX header.

crates/float/src/lib.rs does not include the required SPDX license header. Please add it at the top of the file per REUSE.toml.

As per coding guidelines, **/*.{sol,rs,ts,tsx,js,jsx}: All source files must include SPDX license headers per REUSE.toml specification.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/float/src/lib.rs` around lines 24 - 35, Add the required SPDX license
header to the top of crates/float/src/lib.rs (above the first sol! macro
invocation) using the exact SPDX identifier specified in the repository's
REUSE.toml; ensure the header is a single-line comment like
"SPDX-License-Identifier: <identifier>" and appears before the DecimalFloat and
TestDecimalFloat sol! macros so the file complies with the mandated SPDX header
policy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REUSE.toml already covers crates/**/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

Let me verify the REUSE.toml configuration.


🏁 Script executed:

#!/bin/bash
cat REUSE.toml 2>/dev/null || find . -name "REUSE.toml" -exec cat {} \;

Length of output: 612


@0xgleb, you're right — crates/**/ is explicitly listed in REUSE.toml, which covers all files under that directory including crates/float/src/lib.rs. No per-file SPDX header is needed. My comment was incorrect, sorry for the noise!


✏️ Learnings added
Learnt from: 0xgleb
Repo: rainlanguage/rain.math.float PR: 187
File: crates/float/src/lib.rs:24-35
Timestamp: 2026-05-06T10:07:02.630Z
Learning: In the rain.math.float repository, REUSE.toml uses glob-based annotations to cover entire directory trees (e.g., `crates/**/`, `flake.nix`, etc.) with `SPDX-License-Identifier = "LicenseRef-DCL-1.0"`. Files under these covered paths do NOT require individual in-file SPDX headers; the REUSE.toml annotation satisfies the license requirement for the whole tree.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


#[derive(Debug, Copy, Clone, Default, Serialize, Deserialize, Hash)]
Expand Down
36 changes: 34 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,38 @@

outputs = { self, flake-utils, rainix }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = rainix.pkgs.${system};
let
pkgs = rainix.pkgs.${system};

decimal-float-abi = pkgs.stdenvNoCC.mkDerivation {
pname = "rain-math-float-abi";
version = "0.1.0";
src = ./.;

nativeBuildInputs = [ pkgs.foundry-bin pkgs.solc_0_8_25 ];

FOUNDRY_SOLC = "${pkgs.solc_0_8_25}/bin/solc-0.8.25";
FOUNDRY_OFFLINE = "true";

buildPhase = ''
runHook preBuild
export HOME="$TMPDIR"
forge build
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out
cp out/DecimalFloat.sol/DecimalFloat.json $out/DecimalFloat.json
cp out/TestDecimalFloat.sol/TestDecimalFloat.json $out/TestDecimalFloat.json
runHook postInstall
'';
};
in rec {
packages = rainix.packages.${system} // {
inherit decimal-float-abi;

test-wasm-build = rainix.mkTask.${system} {
name = "test-wasm-build";
body = ''
Expand All @@ -31,7 +60,10 @@
};

devShells.default = pkgs.mkShell {
shellHook = rainix.devShells.${system}.default.shellHook;
shellHook = rainix.devShells.${system}.default.shellHook + ''
export RAIN_MATH_FLOAT_DECIMAL_FLOAT_ABI="$PWD/out/DecimalFloat.sol/DecimalFloat.json"
export RAIN_MATH_FLOAT_TEST_DECIMAL_FLOAT_ABI="$PWD/out/TestDecimalFloat.sol/TestDecimalFloat.json"
'';
packages = [ packages.test-wasm-build packages.test-js-bindings ];
inputsFrom = [ rainix.devShells.${system}.default ];
};
Expand Down
Loading