Skip to content

pre-commit: license headers for Rust files#2731

Open
leshy wants to merge 2 commits into
mainfrom
license-rust-headers
Open

pre-commit: license headers for Rust files#2731
leshy wants to merge 2 commits into
mainfrom
license-rust-headers

Conversation

@leshy

@leshy leshy commented Jul 6, 2026

Copy link
Copy Markdown
Member

Extends insert-license pre-commit hook with a second entry covering *.rs

Backfills all 24 tracked Rust files with the canonical header, replacing the ad-hoc short Copyright/SPDX-License-Identifier

Add a second insert-license entry for *.rs (// comment style) and backfill
all 24 tracked Rust files with the canonical Apache-2.0 header, replacing
the ad-hoc short Copyright/SPDX headers where present.
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds license-header coverage for Rust files. The main changes are:

  • A new Rust entry for the insert-license pre-commit hook.
  • The shared Apache header applied to tracked Rust sources.
  • Short Rust copyright/SPDX headers replaced with the canonical header.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
.pre-commit-config.yaml Adds the Rust license-header hook using the shared template and // comments.
dimos/hardware/sensors/lidar/virtual_mid360/src/main.rs Adds the canonical Apache header.
dimos/mapping/ray_tracing/rust/src/lib.rs Replaces the short SPDX header with the canonical Apache header.
dimos/mapping/ray_tracing/rust/src/main.rs Replaces the short SPDX header with the canonical Apache header.
dimos/mapping/ray_tracing/rust/src/python.rs Replaces the short SPDX header with the canonical Apache header.
dimos/mapping/ray_tracing/rust/src/voxel_ray_tracer.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/adjacency.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/dijkstra.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/edges.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/lib.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/main.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/mls_planner.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/nodes.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/planner.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/python.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/surfaces.rs Replaces the short SPDX header with the canonical Apache header.
dimos/navigation/nav_3d/mls_planner/rust/src/voxel.rs Replaces the short SPDX header with the canonical Apache header.
examples/native-modules/rust/src/native_ping.rs Adds the canonical Apache header.
examples/native-modules/rust/src/native_pong.rs Adds the canonical Apache header.
native/rust/dimos-module-macros/src/lib.rs Adds the canonical Apache header.
native/rust/dimos-module/src/lcm.rs Adds the canonical Apache header.
native/rust/dimos-module/src/lib.rs Adds the canonical Apache header.
native/rust/dimos-module/src/log.rs Adds the canonical Apache header.
native/rust/dimos-module/src/module.rs Adds the canonical Apache header.
native/rust/dimos-module/src/transport.rs Adds the canonical Apache header.

Reviews (2): Last reviewed commit: "Merge branch 'main' into license-rust-he..." | Re-trigger Greptile

Comment thread .pre-commit-config.yaml
@leshy

leshy commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Re the current-year concern: verified idempotent — reran pre-commit run insert-license over all 24 .rs files after the backfill (twice at commit time, once again just now): hook passes, zero files modified, every file has exactly one Copyright line. insert-license matches existing headers with the year normalized (that's what --use-current-year is for), so the 2025 template line vs 2026 file headers doesn't trigger re-insertion.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2649 1 2648 72
View the full list of 1 ❄️ flaky test(s)
dimos.e2e_tests.test_dimsim_walk_forward::test_walk_forward

Flake rate in main: 23.23% (Passed 76 times, Failed 23 times)

Stack Traces | 204s run time
lcm_spy = <dimos.e2e_tests.lcm_spy.LcmSpy object at 0x7d08b298bf50>
start_blueprint = <function start_blueprint.<locals>.set_name_and_start at 0x7d08aff6d260>
human_input = <function human_input.<locals>.send_human_input at 0x7d08aff6cb80>
dim_sim = <dimos.e2e_tests.dim_sim_client.DimSimClient object at 0x7d08b20ab9b0>

    @pytest.mark.self_hosted_large
    def test_walk_forward(lcm_spy, start_blueprint, human_input, dim_sim) -> None:
        start_blueprint(
            "run",
            "--disable",
            "spatial-memory",
            "--disable",
            "security-module",
            "unitree-go2-agentic",
            simulator="dimsim",
        )
        lcm_spy.save_topic(".../McpClient/on_system_modules/res")
        lcm_spy.wait_for_saved_topic(".../McpClient/on_system_modules/res", timeout=1200.0)
    
        origin_x, origin_y = 1, 2
        dim_sim.set_agent_position(origin_x, origin_y)
    
        human_input("move forward 3 meter")
    
>       lcm_spy.wait_until_odom_position(origin_x + 3, origin_y, threshold=0.4, timeout=120)

dim_sim    = <dimos.e2e_tests.dim_sim_client.DimSimClient object at 0x7d08b20ab9b0>
human_input = <function human_input.<locals>.send_human_input at 0x7d08aff6cb80>
lcm_spy    = <dimos.e2e_tests.lcm_spy.LcmSpy object at 0x7d08b298bf50>
origin_x   = 1
origin_y   = 2
start_blueprint = <function start_blueprint.<locals>.set_name_and_start at 0x7d08aff6d260>

dimos/e2e_tests/test_dimsim_walk_forward.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
dimos/e2e_tests/lcm_spy.py:167: in wait_until_odom_position
    self.wait_for_message_result(
        predicate  = <function LcmSpy.wait_until_odom_position.<locals>.predicate at 0x7d08aff6c180>
        self       = <dimos.e2e_tests.lcm_spy.LcmSpy object at 0x7d08b298bf50>
        threshold  = 0.4
        timeout    = 120
        x          = 4
        y          = 2
dimos/e2e_tests/lcm_spy.py:153: in wait_for_message_result
    wait_until(
        event      = <threading.Event at 0x7d08b18dc080: unset>
        fail_message = 'Failed to get to position x=4, y=2'
        listener   = <function LcmSpy.wait_for_message_result.<locals>.listener at 0x7d08aff6d8a0>
        predicate  = <function LcmSpy.wait_until_odom_position.<locals>.predicate at 0x7d08aff6c180>
        self       = <dimos.e2e_tests.lcm_spy.LcmSpy object at 0x7d08b298bf50>
        timeout    = 120
        topic      = '/odom#geometry_msgs.PoseStamped'
        type       = <class 'dimos.msgs.geometry_msgs.PoseStamped.PoseStamped'>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

predicate = <bound method Event.is_set of <threading.Event at 0x7d08b18dc080: unset>>

    def wait_until(
        predicate: Callable[[], bool],
        *,
        timeout: float,
        interval: float = 0.1,
        message: str | None = None,
    ) -> None:
        """Poll ``predicate`` until it returns truthy or ``timeout`` elapses."""
        deadline = time.monotonic() + timeout
        while time.monotonic() < deadline:
            if predicate():
                return
            time.sleep(interval)
>       raise TimeoutError(message or f"Timed out after {timeout}s waiting for condition")
E       TimeoutError: Failed to get to position x=4, y=2

deadline   = 3458743.022540405
interval   = 0.1
message    = 'Failed to get to position x=4, y=2'
predicate  = <bound method Event.is_set of <threading.Event at 0x7d08b18dc080: unset>>
timeout    = 120

.../utils/testing/waiting.py:35: TimeoutError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 6, 2026
@leshy leshy added the PlzReview label Jul 6, 2026
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants