Emil Ernerfeldt commited on
Commit
6ae6e49
0 Parent(s):

Initial commit

Browse files
.clang-format ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BasedOnStyle: Google
2
+
3
+ # Make it slightly more similar to Rust.
4
+ # Based loosely on https://gist.github.com/YodaEmbedding/c2c77dc693d11f3734d78489f9a6eea4
5
+ AccessModifierOffset: -2
6
+ AlignAfterOpenBracket: BlockIndent
7
+ AllowAllArgumentsOnNextLine: false
8
+ AllowShortBlocksOnASingleLine: false
9
+ AllowShortCaseLabelsOnASingleLine: false
10
+ AllowShortFunctionsOnASingleLine: Empty
11
+ AllowShortIfStatementsOnASingleLine: Never
12
+ AlwaysBreakAfterReturnType: None
13
+ AlwaysBreakBeforeMultilineStrings: true
14
+ BinPackArguments: false
15
+ BreakStringLiterals: false
16
+ ColumnLimit: 100
17
+ ContinuationIndentWidth: 4
18
+ DerivePointerAlignment: false
19
+ EmptyLineBeforeAccessModifier: LogicalBlock
20
+ IndentWidth: 4
21
+ IndentWrappedFunctionNames: true
22
+ InsertBraces: true
23
+ InsertTrailingCommas: Wrapped
24
+ MaxEmptyLinesToKeep: 1
25
+ NamespaceIndentation: All
26
+ PointerAlignment: Left
27
+ ReflowComments: false
28
+ SeparateDefinitionBlocks: Always
29
+ SpacesBeforeTrailingComments: 1
30
+
31
+ # Don't change include blocks, we want to control this manually.
32
+ # Sorting headers however is allowed as all our headers should be standalone.
33
+ IncludeBlocks: Preserve
34
+ SortIncludes: CaseInsensitive
.github/workflows/cpp.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ on: [push, pull_request]
3
+
4
+ name: C++
5
+
6
+ jobs:
7
+ cpp-check:
8
+ name: C++
9
+ runs-on: ubuntu-22.04
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+
13
+ - uses: prefix-dev/[email protected]
14
+ with:
15
+ pixi-version: v0.19.0
16
+ cache: true
17
+
18
+ - run: pixi run build
19
+
20
+ - run: pixi run cpp-fmt-check
.github/workflows/labels.yml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+
3
+ # https://github.com/marketplace/actions/require-labels
4
+ # Check for existence of labels
5
+ # See all our labels at https://github.com/rerun-io/rerun/issues/labels
6
+
7
+ name: PR Labels
8
+
9
+ on:
10
+ pull_request:
11
+ types:
12
+ - opened
13
+ - synchronize
14
+ - reopened
15
+ - labeled
16
+ - unlabeled
17
+
18
+ jobs:
19
+ label:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Check for a "do-not-merge" label
23
+ uses: mheap/github-action-required-labels@v3
24
+ with:
25
+ mode: exactly
26
+ count: 0
27
+ labels: "do-not-merge"
28
+
29
+ - name: Require label "include in changelog" or "exclude from changelog"
30
+ uses: mheap/github-action-required-labels@v3
31
+ with:
32
+ mode: minimum
33
+ count: 1
34
+ labels: "exclude from changelog, include in changelog"
.github/workflows/links.yml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ on: [push, pull_request]
3
+
4
+ name: Link checker
5
+
6
+ jobs:
7
+ link-checker:
8
+ name: Check links
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+
13
+ - name: Restore link checker cache
14
+ uses: actions/cache@v3
15
+ with:
16
+ path: .lycheecache
17
+ key: cache-lychee-${{ github.sha }}
18
+ restore-keys: cache-lychee-
19
+
20
+ # Check https://github.com/lycheeverse/lychee on how to run locally.
21
+ - name: Link Checker
22
+ id: lychee
23
+ uses: lycheeverse/[email protected]
24
+ with:
25
+ fail: true
26
+ lycheeVersion: "0.14.3"
27
+ # When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually.
28
+ args: |
29
+ --base . --cache --max-cache-age 1d . "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml"
.github/workflows/python.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ on: [push, pull_request]
3
+
4
+ name: C++
5
+
6
+ jobs:
7
+ python-check:
8
+ name: Python
9
+ runs-on: ubuntu-22.04
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+
13
+ - uses: prefix-dev/[email protected]
14
+ with:
15
+ pixi-version: v0.19.0
16
+ cache: true
17
+
18
+ - run: pixi run py-fmt-check
19
+
20
+ - run: pixi run py-lint
.github/workflows/rust.yml ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ on: [push, pull_request]
3
+
4
+ name: Rust
5
+
6
+ env:
7
+ RUSTFLAGS: -D warnings
8
+ RUSTDOCFLAGS: -D warnings
9
+
10
+ jobs:
11
+ rust-check:
12
+ name: Rust
13
+ runs-on: ubuntu-22.04
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions-rs/toolchain@v1
18
+ with:
19
+ profile: default
20
+ toolchain: 1.76.0
21
+ override: true
22
+
23
+ - name: Install packages (Linux)
24
+ if: runner.os == 'Linux' && false # TODO: enable if eframe is part of the project, otherwise remove
25
+ uses: awalsh128/[email protected]
26
+ with:
27
+ # some deps used by eframe, if that is part of the project
28
+ packages: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev # libgtk-3-dev is used by rfd
29
+ version: 1.0
30
+ execute_install_scripts: true
31
+
32
+ - name: Set up cargo cache
33
+ uses: Swatinem/rust-cache@v2
34
+
35
+ - name: Rustfmt
36
+ uses: actions-rs/cargo@v1
37
+ with:
38
+ command: fmt
39
+ args: --all -- --check
40
+
41
+ - name: Install cargo-cranky
42
+ uses: baptiste0928/cargo-install@v1
43
+ with:
44
+ crate: cargo-cranky
45
+
46
+ - name: check --all-features
47
+ uses: actions-rs/cargo@v1
48
+ with:
49
+ command: check
50
+ args: --all-features --all-targets
51
+
52
+ - name: check default features
53
+ uses: actions-rs/cargo@v1
54
+ with:
55
+ command: check
56
+ args: --all-targets
57
+
58
+ - name: check --no-default-features
59
+ uses: actions-rs/cargo@v1
60
+ with:
61
+ command: check
62
+ args: --no-default-features --lib --all-targets
63
+
64
+ - name: Test doc-tests
65
+ uses: actions-rs/cargo@v1
66
+ with:
67
+ command: test
68
+ args: --doc --all-features
69
+
70
+ - name: cargo doc --lib
71
+ uses: actions-rs/cargo@v1
72
+ with:
73
+ command: doc
74
+ args: --lib --no-deps --all-features
75
+
76
+ - name: cargo doc --document-private-items
77
+ uses: actions-rs/cargo@v1
78
+ with:
79
+ command: doc
80
+ args: --document-private-items --no-deps --all-features
81
+
82
+ - name: Build tests
83
+ uses: actions-rs/cargo@v1
84
+ with:
85
+ command: test
86
+ args: --all-features --no-run
87
+
88
+ - name: Run test
89
+ uses: actions-rs/cargo@v1
90
+ with:
91
+ command: test
92
+ args: --all-features
93
+
94
+ - name: Cranky
95
+ uses: actions-rs/cargo@v1
96
+ with:
97
+ command: cranky
98
+ args: --all-targets --all-features -- -D warnings
99
+
100
+ # ---------------------------------------------------------------------------
101
+
102
+ check_wasm:
103
+ name: Check wasm32
104
+ runs-on: ubuntu-22.04
105
+ steps:
106
+ - uses: actions/checkout@v4
107
+ - uses: actions-rs/toolchain@v1
108
+ with:
109
+ profile: minimal
110
+ toolchain: 1.76.0
111
+ target: wasm32-unknown-unknown
112
+ override: true
113
+
114
+ - run: sudo apt-get update && sudo apt-get install libgtk-3-dev
115
+
116
+ - name: Set up cargo cache
117
+ uses: Swatinem/rust-cache@v2
118
+
119
+ - name: Install cargo-cranky
120
+ uses: baptiste0928/cargo-install@v1
121
+ with:
122
+ crate: cargo-cranky
123
+
124
+ - name: Check wasm32
125
+ uses: actions-rs/cargo@v1
126
+ with:
127
+ command: check
128
+ args: --target wasm32-unknown-unknown
129
+
130
+ - name: Cranky wasm32
131
+ env:
132
+ CLIPPY_CONF_DIR: "scripts/clippy_wasm" # Use scripts/clippy_wasm/clippy.toml
133
+ run: cargo cranky --target wasm32-unknown-unknown -- -D warnings
134
+
135
+ # ---------------------------------------------------------------------------
136
+
137
+ cargo-deny:
138
+ runs-on: ubuntu-22.04
139
+ steps:
140
+ - uses: actions/checkout@v3
141
+ - uses: EmbarkStudios/cargo-deny-action@v1
142
+ with:
143
+ rust-version: "1.76.0"
144
+ log-level: warn
145
+ command: check
.github/workflows/typos.yml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+
3
+ # https://github.com/crate-ci/typos
4
+ # Add exceptions to `.typos.toml`
5
+ # install and run locally: cargo install typos-cli && typos
6
+
7
+ name: Spell Check
8
+ on: [pull_request]
9
+
10
+ jobs:
11
+ run:
12
+ name: Spell Check
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout Actions Repository
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Check spelling of entire workspace
19
+ uses: crate-ci/typos@master
.gitignore ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Mac stuff:
2
+ .DS_Store
3
+
4
+ # C++ build directory
5
+ build
6
+
7
+ # Rust compile target directories:
8
+ target
9
+ target_ra
10
+ target_wasm
11
+
12
+ # https://github.com/lycheeverse/lychee
13
+ .lycheecache
14
+
15
+ # Pixi environment
16
+ .pixi
17
+ .ruff_cache
.mypy.ini ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [mypy]
2
+ files = .
3
+ exclude = build
4
+ namespace_packages = True
5
+ show_error_codes = True
6
+ strict = True
7
+ enable_error_code = redundant-expr, truthy-bool, ignore-without-code
8
+ ; plugins = numpy.typing.mypy_plugin
9
+ ignore_missing_imports = True
10
+ no_implicit_reexport = False
11
+ disallow_untyped_calls = False
.typos.toml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # https://github.com/crate-ci/typos
2
+ # install: cargo install typos-cli
3
+ # run: typos
4
+
5
+ [default.extend-words]
6
+ teh = "teh" # part of @teh-cmc
.vscode/extensions.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // See https://go.microsoft.com/fwlink/?LinkId=827846
3
+ // for the documentation about the extensions.json format
4
+ "recommendations": [
5
+ "charliermarsh.ruff",
6
+ "gaborv.flatbuffers",
7
+ "github.vscode-github-actions",
8
+ "josetr.cmake-language-support-vscode",
9
+ "ms-python.mypy-type-checker",
10
+ "ms-python.python",
11
+ "ms-vscode.cmake-tools",
12
+ "ms-vscode.cpptools-extension-pack",
13
+ "ms-vsliveshare.vsliveshare",
14
+ "polymeilex.wgsl",
15
+ "rust-lang.rust-analyzer",
16
+ "serayuzgur.crates",
17
+ "streetsidesoftware.code-spell-checker",
18
+ "tamasfe.even-better-toml",
19
+ "vadimcn.vscode-lldb",
20
+ "wayou.vscode-todo-highlight",
21
+ "webfreak.debug",
22
+ "xaver.clang-format", // C++ formatter
23
+ "zxh404.vscode-proto3",
24
+ "esbenp.prettier-vscode"
25
+ ]
26
+ }
.vscode/launch.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ // Python
8
+ {
9
+ "name": "Python Debugger: Current File",
10
+ "type": "debugpy",
11
+ "request": "launch",
12
+ "program": "${file}",
13
+ "console": "integratedTerminal"
14
+ },
15
+ // Rust:
16
+ {
17
+ "name": "Debug 'rerun_template'",
18
+ "type": "lldb",
19
+ "request": "launch",
20
+ "cargo": {
21
+ "args": [
22
+ "build"
23
+ ],
24
+ "filter": {
25
+ "name": "rerun_template",
26
+ "kind": "bin"
27
+ }
28
+ },
29
+ "args": [],
30
+ "cwd": "${workspaceFolder}",
31
+ "env": {
32
+ "RUST_LOG": "debug"
33
+ }
34
+ },
35
+ {
36
+ "name": "Launch Rust tests",
37
+ "type": "lldb",
38
+ "request": "launch",
39
+ "cargo": {
40
+ "args": [
41
+ "test",
42
+ "--no-run",
43
+ "--lib",
44
+ "--all-features"
45
+ ],
46
+ "filter": {
47
+ "kind": "lib"
48
+ }
49
+ },
50
+ "cwd": "${workspaceFolder}",
51
+ "env": {
52
+ "RUST_LOG": "debug"
53
+ }
54
+ },
55
+ ]
56
+ }
.vscode/settings.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.semanticTokenColorCustomizations": {
4
+ "rules": {
5
+ "*.unsafe:rust": "#eb5046"
6
+ }
7
+ },
8
+ "files.autoGuessEncoding": true,
9
+ "files.insertFinalNewline": true,
10
+ "files.trimTrailingWhitespace": true,
11
+ // don't share a cargo lock with rust-analyzer.
12
+ // see https://github.com/rerun-io/rerun/pull/519 for rationale
13
+ "rust-analyzer.check.overrideCommand": [
14
+ "cargo",
15
+ "cranky",
16
+ "--target-dir=target_ra",
17
+ "--workspace",
18
+ "--message-format=json",
19
+ "--all-targets",
20
+ "--all-features"
21
+ ],
22
+ "rust-analyzer.cargo.buildScripts.overrideCommand": [
23
+ "cargo",
24
+ "check",
25
+ "--quiet",
26
+ "--target-dir=target_ra",
27
+ "--workspace",
28
+ "--message-format=json",
29
+ "--all-targets",
30
+ "--all-features",
31
+ ],
32
+ // Our build scripts are generating code.
33
+ // Having Rust Analyzer do this while doing other builds can lead to catastrophic failures.
34
+ // INCLUDING attempts to publish a new release!
35
+ "rust-analyzer.cargo.buildScripts.enable": false,
36
+ "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", // Use cmake-tools to grab configs.
37
+ "C_Cpp.autoAddFileAssociations": false,
38
+ "cmake.buildDirectory": "${workspaceRoot}/build/debug",
39
+ "cmake.generator": "Ninja", // Use Ninja, just like we do in our just/pixi command.
40
+ "rust-analyzer.showUnlinkedFileNotification": false,
41
+ "ruff.format.args": [
42
+ "--config=pyproject.toml"
43
+ ],
44
+ "ruff.lint.args": [
45
+ "--config=pyproject.toml"
46
+ ],
47
+ "prettier.requireConfig": true,
48
+ "prettier.configPath": ".prettierrc.toml",
49
+ "[python]": {
50
+ "editor.defaultFormatter": "charliermarsh.ruff"
51
+ },
52
+ }
CHANGELOG.md ADDED
@@ -0,0 +1 @@
 
 
1
+ # Changelog
CMakeLists.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 3.16...3.27)
2
+
3
+ project(rerun_template LANGUAGES CXX) # TODO
4
+
5
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
6
+
7
+ if(NOT DEFINED CMAKE_CXX_STANDARD)
8
+ set(CMAKE_CXX_STANDARD 17)
9
+ endif()
10
+
11
+ # Rerun:
12
+ include(FetchContent)
13
+ FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.15.1/rerun_cpp_sdk.zip)
14
+ FetchContent_MakeAvailable(rerun_sdk)
15
+
16
+ add_executable(rerun_template src/main.cpp) # TODO
17
+ target_link_libraries(rerun_template rerun_sdk) # TODO
18
+ target_include_directories(rerun_template PRIVATE src) # TODO
CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
Cargo.lock ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "rerun_template"
7
+ version = "0.1.0"
Cargo.toml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [package]
2
+ authors = ["rerun.io <[email protected]>"]
3
+ categories = [] # TODO
4
+ description = "" # TODO
5
+ edition = "2021"
6
+ homepage = "https://github.com/rerun-io/rerun_template" # TODO
7
+ include = ["LICENSE-APACHE", "LICENSE-MIT", "**/*.rs", "Cargo.toml"]
8
+ keywords = [] # TODO
9
+ license = "MIT OR Apache-2.0"
10
+ name = "rerun_template" # TODO
11
+ readme = "README.md"
12
+ repository = "https://github.com/rerun-io/rerun_template" # TODO
13
+ rust-version = "1.76"
14
+ version = "0.1.0"
15
+
16
+ [package.metadata.docs.rs]
17
+ all-features = true
18
+
19
+
20
+ [features]
21
+ default = []
22
+
23
+
24
+ [dependencies]
25
+
26
+
27
+ [dev-dependencies]
28
+
29
+
30
+ [patch.crates-io]
Cranky.toml ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ #
3
+ # https://github.com/ericseppanen/cargo-cranky
4
+ # cargo install cargo-cranky && cargo cranky
5
+ # See also clippy.toml
6
+
7
+ deny = [
8
+ "unsafe_code",
9
+ #"clippy::self_named_module_files", # Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
10
+ ]
11
+
12
+ warn = [
13
+ "clippy::all",
14
+ "clippy::as_ptr_cast_mut",
15
+ "clippy::await_holding_lock",
16
+ "clippy::bool_to_int_with_if",
17
+ "clippy::char_lit_as_u8",
18
+ "clippy::checked_conversions",
19
+ "clippy::clear_with_drain",
20
+ "clippy::cloned_instead_of_copied",
21
+ "clippy::cloned_instead_of_copied",
22
+ "clippy::dbg_macro",
23
+ "clippy::debug_assert_with_mut_call",
24
+ "clippy::derive_partial_eq_without_eq",
25
+ "clippy::disallowed_macros", # See clippy.toml
26
+ "clippy::disallowed_methods", # See clippy.toml
27
+ "clippy::disallowed_names", # See clippy.toml
28
+ "clippy::disallowed_script_idents", # See clippy.toml
29
+ "clippy::disallowed_types", # See clippy.toml
30
+ "clippy::doc_link_with_quotes",
31
+ "clippy::doc_markdown",
32
+ "clippy::empty_enum",
33
+ "clippy::enum_glob_use",
34
+ "clippy::equatable_if_let",
35
+ "clippy::exit",
36
+ "clippy::expl_impl_clone_on_copy",
37
+ "clippy::explicit_deref_methods",
38
+ "clippy::explicit_into_iter_loop",
39
+ "clippy::explicit_iter_loop",
40
+ "clippy::fallible_impl_from",
41
+ "clippy::filter_map_next",
42
+ "clippy::flat_map_option",
43
+ "clippy::float_cmp_const",
44
+ "clippy::fn_params_excessive_bools",
45
+ "clippy::fn_to_numeric_cast_any",
46
+ "clippy::from_iter_instead_of_collect",
47
+ "clippy::get_unwrap",
48
+ "clippy::if_let_mutex",
49
+ "clippy::implicit_clone",
50
+ "clippy::imprecise_flops",
51
+ "clippy::index_refutable_slice",
52
+ "clippy::inefficient_to_string",
53
+ "clippy::infinite_loop",
54
+ "clippy::into_iter_without_iter",
55
+ "clippy::invalid_upcast_comparisons",
56
+ "clippy::iter_not_returning_iterator",
57
+ "clippy::iter_on_empty_collections",
58
+ "clippy::iter_on_single_items",
59
+ "clippy::iter_over_hash_type",
60
+ "clippy::iter_without_into_iter",
61
+ "clippy::large_digit_groups",
62
+ "clippy::large_include_file",
63
+ "clippy::large_stack_arrays",
64
+ "clippy::large_stack_frames",
65
+ "clippy::large_types_passed_by_value",
66
+ "clippy::let_underscore_untyped",
67
+ "clippy::let_unit_value",
68
+ "clippy::linkedlist",
69
+ "clippy::lossy_float_literal",
70
+ "clippy::macro_use_imports",
71
+ "clippy::manual_assert",
72
+ "clippy::manual_clamp",
73
+ "clippy::manual_instant_elapsed",
74
+ "clippy::manual_let_else",
75
+ "clippy::manual_ok_or",
76
+ "clippy::manual_string_new",
77
+ "clippy::map_err_ignore",
78
+ "clippy::map_flatten",
79
+ "clippy::map_unwrap_or",
80
+ "clippy::match_on_vec_items",
81
+ "clippy::match_same_arms",
82
+ "clippy::match_wild_err_arm",
83
+ "clippy::match_wildcard_for_single_variants",
84
+ "clippy::mem_forget",
85
+ "clippy::mismatched_target_os",
86
+ "clippy::mismatching_type_param_order",
87
+ "clippy::missing_assert_message",
88
+ "clippy::missing_enforced_import_renames",
89
+ "clippy::missing_errors_doc",
90
+ "clippy::missing_safety_doc",
91
+ "clippy::mut_mut",
92
+ "clippy::mutex_integer",
93
+ "clippy::needless_borrow",
94
+ "clippy::needless_continue",
95
+ "clippy::needless_for_each",
96
+ "clippy::needless_pass_by_ref_mut",
97
+ "clippy::needless_pass_by_value",
98
+ "clippy::negative_feature_names",
99
+ "clippy::nonstandard_macro_braces",
100
+ "clippy::option_option",
101
+ "clippy::path_buf_push_overwrite",
102
+ "clippy::ptr_as_ptr",
103
+ "clippy::ptr_cast_constness",
104
+ "clippy::pub_without_shorthand",
105
+ "clippy::rc_mutex",
106
+ "clippy::readonly_write_lock",
107
+ "clippy::redundant_type_annotations",
108
+ "clippy::ref_option_ref",
109
+ "clippy::ref_patterns",
110
+ "clippy::rest_pat_in_fully_bound_structs",
111
+ "clippy::same_functions_in_if_condition",
112
+ "clippy::semicolon_if_nothing_returned",
113
+ "clippy::should_panic_without_expect",
114
+ "clippy::significant_drop_tightening",
115
+ "clippy::single_match_else",
116
+ "clippy::str_to_string",
117
+ "clippy::string_add_assign",
118
+ "clippy::string_add",
119
+ "clippy::string_lit_as_bytes",
120
+ "clippy::string_lit_chars_any",
121
+ "clippy::string_to_string",
122
+ "clippy::suspicious_command_arg_space",
123
+ "clippy::suspicious_xor_used_as_pow",
124
+ "clippy::todo",
125
+ "clippy::too_many_lines",
126
+ "clippy::trailing_empty_array",
127
+ "clippy::trait_duplication_in_bounds",
128
+ "clippy::tuple_array_conversions",
129
+ "clippy::unchecked_duration_subtraction",
130
+ "clippy::undocumented_unsafe_blocks",
131
+ "clippy::unimplemented",
132
+ "clippy::uninhabited_references",
133
+ "clippy::uninlined_format_args",
134
+ "clippy::unnecessary_box_returns",
135
+ "clippy::unnecessary_safety_doc",
136
+ "clippy::unnecessary_struct_initialization",
137
+ "clippy::unnecessary_wraps",
138
+ "clippy::unnested_or_patterns",
139
+ "clippy::unused_peekable",
140
+ "clippy::unused_rounding",
141
+ "clippy::unused_self",
142
+ "clippy::unwrap_used",
143
+ "clippy::useless_transmute",
144
+ "clippy::verbose_file_reads",
145
+ "clippy::wildcard_dependencies",
146
+ "clippy::wildcard_imports",
147
+ "clippy::zero_sized_map_values",
148
+ "elided_lifetimes_in_paths",
149
+ "future_incompatible",
150
+ "nonstandard_style",
151
+ "rust_2018_idioms",
152
+ "rust_2021_prelude_collisions",
153
+ "rustdoc::missing_crate_level_docs",
154
+ "semicolon_in_expressions_from_macros",
155
+ "trivial_casts",
156
+ "trivial_numeric_casts",
157
+ "unsafe_op_in_unsafe_fn", # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
158
+ "unused_extern_crates",
159
+ "unused_import_braces",
160
+ "unused_lifetimes",
161
+ "unused_qualifications",
162
+ ]
163
+
164
+ allow = [
165
+ "clippy::manual_range_contains", # this one is just worse imho
166
+ ]
LICENSE-APACHE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
LICENSE-MIT ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2024 Rerun Technologies AB <[email protected]>
2
+
3
+ Permission is hereby granted, free of charge, to any
4
+ person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the
6
+ Software without restriction, including without
7
+ limitation the rights to use, copy, modify, merge,
8
+ publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software
10
+ is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice
14
+ shall be included in all copies or substantial portions
15
+ of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
18
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
21
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
24
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
+ DEALINGS IN THE SOFTWARE.
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Rerun template repository
2
+ Template for our private and public repos, containing CI, CoC, etc
3
+
4
+ When creating a new Rerun repository, use this as a template, then modify it as it makes sense.
5
+
6
+ This template should be the default for any repository of any kind, including:
7
+ * Rust projects
8
+ * C++ projects
9
+ * Python projects
10
+ * Other stuff
11
+
12
+ This template includes
13
+ * License files
14
+ * Code of Conduct
15
+ * Helpers for checking and linting Rust code
16
+ - `cargo-cranky`
17
+ - `cargo-deny`
18
+ - `rust-toolchain`
19
+ * CI for:
20
+ - Spell checking
21
+ - Link checking
22
+ - Rust checks
23
+
24
+
25
+ ## How to use
26
+ Start by clicking "Use this template" at https://github.com/rerun-io/rerun_template/ or follow [these instructions](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template).
27
+
28
+ Then follow these steps:
29
+ * Search and replace `rerun_template` with the name of the repository
30
+ * Run `scripts/template_update.py init --languages cpp,rust,python` to delete files you don't need (give the languages you need support for)
31
+ * Search for `TODO` and fill in all those places
32
+ * Replace this `README.md` with something better
33
+ * Commit!
34
+
35
+ In the future you can always update this repository with the latest changes from the template by running:
36
+ * `scripts/template_update.py update --languages cpp,rust,python`
bacon.toml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a configuration file for the bacon tool
2
+ # More info at https://github.com/Canop/bacon
3
+
4
+ default_job = "cranky"
5
+
6
+ [jobs]
7
+
8
+ [jobs.cranky]
9
+ command = [
10
+ "cargo",
11
+ "cranky",
12
+ "--all-targets",
13
+ "--all-features",
14
+ "--color=always",
15
+ ]
16
+ need_stdout = false
17
+ watch = ["tests", "benches", "examples"]
18
+
19
+ [jobs.check]
20
+ command = [
21
+ "cargo",
22
+ "check",
23
+ "--all-targets",
24
+ "--all-features",
25
+ "--color=always",
26
+ ]
27
+ need_stdout = false
28
+ watch = ["tests", "benches", "examples"]
29
+
30
+ [jobs.test]
31
+ command = ["cargo", "test", "--color=always"]
32
+ need_stdout = true
33
+ watch = ["tests"]
34
+
35
+ [jobs.doc]
36
+ command = ["cargo", "doc", "--color=always", "--all-features", "--no-deps"]
37
+ need_stdout = false
38
+
39
+ # if the doc compiles, then it opens in your browser and bacon switches
40
+ # to the previous job
41
+ [jobs.doc-open]
42
+ command = [
43
+ "cargo",
44
+ "doc",
45
+ "--color=always",
46
+ "--all-features",
47
+ "--no-deps",
48
+ "--open",
49
+ ]
50
+ need_stdout = false
51
+ on_success = "back" # so that we don't open the browser at each change
52
+
53
+ # You can run your application and have the result displayed in bacon,
54
+ # *if* it makes sense for this crate. You can run an example the same
55
+ # way. Don't forget the `--color always` part or the errors won't be
56
+ # properly parsed.
57
+ [jobs.run]
58
+ command = ["cargo", "run", "--color=always"]
59
+ need_stdout = true
60
+
61
+ # You may define here keybindings that would be specific to
62
+ # a project, for example a shortcut to launch a specific job.
63
+ # Shortcuts to internal functions (scrolling, toggling, etc.)
64
+ # should go in your personal prefs.toml file instead.
65
+ [keybindings]
66
+ i = "job:initial"
67
+ c = "job:cranky"
68
+ d = "job:doc-open"
69
+ t = "job:test"
70
+ r = "job:run"
clippy.toml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ #
3
+ # There is also a scripts/clippy_wasm/clippy.toml which forbids some methods that are not available in wasm.
4
+
5
+ # -----------------------------------------------------------------------------
6
+ # Section identical to scripts/clippy_wasm/clippy.toml:
7
+
8
+ msrv = "1.76"
9
+
10
+ allow-unwrap-in-tests = true
11
+
12
+ # https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#avoid-breaking-exported-api
13
+ # We want suggestions, even if it changes public API.
14
+ avoid-breaking-exported-api = false
15
+
16
+ excessive-nesting-threshold = 8
17
+
18
+ max-fn-params-bools = 1
19
+
20
+ # https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file
21
+ max-include-file-size = 1000000
22
+
23
+ # https://rust-lang.github.io/rust-clippy/master/index.html#/large_stack_frames
24
+ stack-size-threshold = 512000
25
+
26
+ too-many-lines-threshold = 200
27
+
28
+ # -----------------------------------------------------------------------------
29
+
30
+ # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
31
+ disallowed-macros = ['dbg']
32
+
33
+ # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
34
+ disallowed-methods = [
35
+ { path = "egui_extras::TableBody::row", reason = "`row` doesn't scale. Use `rows` instead." },
36
+ { path = "glam::Vec2::normalize", reason = "normalize() can create NaNs. Use try_normalize or normalize_or_zero" },
37
+ { path = "glam::Vec3::normalize", reason = "normalize() can create NaNs. Use try_normalize or normalize_or_zero" },
38
+ { path = "sha1::Digest::new", reason = "SHA1 is cryptographically broken" },
39
+ { path = "std::env::temp_dir", reason = "Use the tempdir crate instead" },
40
+ { path = "std::panic::catch_unwind", reason = "We compile with `panic = 'abort'`" },
41
+ { path = "std::thread::spawn", reason = "Use `std::thread::Builder` and name the thread" },
42
+
43
+ # There are many things that aren't allowed on wasm,
44
+ # but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406)
45
+ # so we do that in `scripts/clippy_wasm/clippy.toml` instead.
46
+ ]
47
+
48
+ # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
49
+ disallowed-names = []
50
+
51
+ # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
52
+ disallowed-types = [
53
+ { path = "ring::digest::SHA1_FOR_LEGACY_USE_ONLY", reason = "SHA1 is cryptographically broken" },
54
+
55
+ { path = "std::sync::Condvar", reason = "Use parking_lot instead" },
56
+ { path = "std::sync::Mutex", reason = "Use parking_lot instead" },
57
+ { path = "std::sync::RwLock", reason = "Use parking_lot instead" },
58
+
59
+ # "std::sync::Once", # enabled for now as the `log_once` macro uses it internally
60
+ ]
61
+
62
+ # Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
63
+ doc-valid-idents = [
64
+ # You must also update the same list in `scripts/clippy_wasm/clippy.toml`!
65
+ "GitHub",
66
+ "GLB",
67
+ "GLTF",
68
+ "iOS",
69
+ "macOS",
70
+ "NaN",
71
+ "OBJ",
72
+ "OpenGL",
73
+ "PyPI",
74
+ "sRGB",
75
+ "sRGBA",
76
+ "WebGL",
77
+ "WebSocket",
78
+ "WebSockets",
79
+ ]
deny.toml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+ #
3
+ # https://github.com/EmbarkStudios/cargo-deny
4
+ #
5
+ # cargo-deny checks our dependency tree for copy-left licenses,
6
+ # duplicate dependencies, and rustsec advisories (https://rustsec.org/advisories).
7
+ #
8
+ # Install: `cargo install cargo-deny`
9
+ # Check: `cargo deny check`.
10
+
11
+
12
+ # Note: running just `cargo deny check` without a `--target` can result in
13
+ # false positives due to https://github.com/EmbarkStudios/cargo-deny/issues/324
14
+ [graph]
15
+ targets = [
16
+ { triple = "aarch64-apple-darwin" },
17
+ { triple = "i686-pc-windows-gnu" },
18
+ { triple = "i686-pc-windows-msvc" },
19
+ { triple = "i686-unknown-linux-gnu" },
20
+ { triple = "wasm32-unknown-unknown" },
21
+ { triple = "x86_64-apple-darwin" },
22
+ { triple = "x86_64-pc-windows-gnu" },
23
+ { triple = "x86_64-pc-windows-msvc" },
24
+ { triple = "x86_64-unknown-linux-gnu" },
25
+ { triple = "x86_64-unknown-linux-musl" },
26
+ { triple = "x86_64-unknown-redox" },
27
+ ]
28
+ all-features = true
29
+
30
+
31
+ [advisories]
32
+ version = 2
33
+ ignore = [
34
+ "RUSTSEC-2023-0081", # TODO(#5998): unmaintained crate "safemem" pulled in by "cargo-run-wasm"
35
+ ]
36
+
37
+
38
+ [bans]
39
+ multiple-versions = "deny"
40
+ wildcards = "allow" # We use them for examples
41
+ deny = []
42
+ skip = []
43
+ skip-tree = []
44
+
45
+
46
+ [licenses]
47
+ version = 2
48
+ private = { ignore = true }
49
+ confidence-threshold = 0.93 # We want really high confidence when inferring licenses from text
50
+ allow = [
51
+ "Apache-2.0 WITH LLVM-exception", # https://spdx.org/licenses/LLVM-exception.html
52
+ "Apache-2.0", # https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)
53
+ "BSD-2-Clause", # https://tldrlegal.com/license/bsd-2-clause-license-(freebsd)
54
+ "BSD-3-Clause", # https://tldrlegal.com/license/bsd-3-clause-license-(revised)
55
+ "BSL-1.0", # https://tldrlegal.com/license/boost-software-license-1.0-explained
56
+ "CC0-1.0", # https://creativecommons.org/publicdomain/zero/1.0/
57
+ "ISC", # https://www.tldrlegal.com/license/isc-license
58
+ "LicenseRef-UFL-1.0", # See https://github.com/emilk/egui/issues/2321
59
+ "MIT-0", # https://choosealicense.com/licenses/mit-0/
60
+ "MIT", # https://tldrlegal.com/license/mit-license
61
+ "MPL-2.0", # https://www.mozilla.org/en-US/MPL/2.0/FAQ/ - see Q11. Used by webpki-roots on Linux.
62
+ "OFL-1.1", # https://spdx.org/licenses/OFL-1.1.html
63
+ "OpenSSL", # https://www.openssl.org/source/license.html - used on Linux
64
+ "Unicode-DFS-2016", # https://spdx.org/licenses/Unicode-DFS-2016.html
65
+ "Zlib", # https://tldrlegal.com/license/zlib-libpng-license-(zlib)
66
+ ]
67
+ exceptions = []
68
+
69
+ [[licenses.clarify]]
70
+ name = "webpki"
71
+ expression = "ISC"
72
+ license-files = [{ path = "LICENSE", hash = 0x001c7e6c }]
73
+
74
+ [[licenses.clarify]]
75
+ name = "ring"
76
+ expression = "MIT AND ISC AND OpenSSL"
77
+ license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
78
+
79
+
80
+ [sources]
81
+ unknown-registry = "deny"
82
+ unknown-git = "deny"
83
+
84
+ [sources.allow-org]
85
+ github = ["emilk", "rerun-io"]
lychee.toml ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+
3
+ ################################################################################
4
+ # Config for the link checker lychee.
5
+ #
6
+ # Download & learn more at:
7
+ # https://github.com/lycheeverse/lychee
8
+ #
9
+ # Example config:
10
+ # https://github.com/lycheeverse/lychee/blob/master/lychee.example.toml
11
+ #
12
+ # Run `lychee . --dump` to list all found links that are being checked.
13
+ #
14
+ # Note that by default lychee will only check markdown and html files,
15
+ # to check any other files you have to point to them explicitly, e.g.:
16
+ # `lychee **/*.rs`
17
+ # To make things worse, `exclude_path` is ignored for these globs,
18
+ # so local runs with lots of gitignored files will be slow.
19
+ # (https://github.com/lycheeverse/lychee/issues/1405)
20
+ #
21
+ # This unfortunately doesn't list anything for non-glob checks.
22
+ ################################################################################
23
+
24
+ # Maximum number of concurrent link checks.
25
+ # Workaround for "too many open files" error on MacOS, see https://github.com/lycheeverse/lychee/issues/1248
26
+ max_concurrency = 32
27
+
28
+ # Check links inside `<code>` and `<pre>` blocks as well as Markdown code blocks.
29
+ include_verbatim = true
30
+
31
+ # Proceed for server connections considered insecure (invalid TLS).
32
+ insecure = true
33
+
34
+ # Exclude these filesystem paths from getting checked.
35
+ exclude_path = [
36
+ # Unfortunately lychee doesn't yet read .gitignore https://github.com/lycheeverse/lychee/issues/1331
37
+ # The following entries are there because of that:
38
+ ".git",
39
+ "__pycache__",
40
+ "_deps/",
41
+ ".pixi",
42
+ "build",
43
+ "target_ra",
44
+ "target_wasm",
45
+ "target",
46
+ "venv",
47
+ ]
48
+
49
+ # Exclude URLs and mail addresses from checking (supports regex).
50
+ exclude = [
51
+ # Skip speculative links
52
+ '.*?speculative-link',
53
+
54
+ # Strings with replacements.
55
+ '/__VIEWER_VERSION__/', # Replacement variable __VIEWER_VERSION__.
56
+ '/\$', # Replacement variable $.
57
+ '/GIT_HASH/', # Replacement variable GIT_HASH.
58
+ '\{\}', # Ignore links with string interpolation.
59
+ '\$relpath\^', # Relative paths as used by rerun_cpp's doc header.
60
+ '%7B.+%7D', # Ignore strings that look like ready to use links but contain a replacement strings. The URL escaping is for '{.+}' (this seems to be needed for html embedded urls since lychee assumes they use this encoding).
61
+ '%7B%7D', # Ignore links with string interpolation, escaped variant.
62
+
63
+ # Local links that require further setup.
64
+ 'http://127.0.0.1',
65
+ 'http://localhost',
66
+ 'recording:/', # rrd recording link.
67
+ 'ws:/',
68
+ 're_viewer.js', # Build artifact that html is linking to.
69
+
70
+ # Api endpoints.
71
+ 'https://fonts.googleapis.com/', # Font API entrypoint, not a link.
72
+ 'https://fonts.gstatic.com/', # Font API entrypoint, not a link.
73
+ 'https://tel.rerun.io/', # Analytics endpoint.
74
+
75
+ # Avoid rate limiting.
76
+ 'https://crates.io/crates/.*', # Avoid crates.io rate-limiting
77
+ 'https://github.com/rerun-io/rerun/commit/\.*', # Ignore links to our own commits (typically in changelog).
78
+ 'https://github.com/rerun-io/rerun/pull/\.*', # Ignore links to our own pull requests (typically in changelog).
79
+
80
+ # Intentionally faked links.
81
+ 'file://foo',
82
+ 'http://foo.com/',
83
+ 'https://link.to',
84
+ 'https://static.rerun.io/my_screenshot/',
85
+
86
+ # Link fragments and data links in examples.
87
+ 'https://raw.githubusercontent.com/googlefonts/noto-emoji/', # URL fragment.
88
+ 'https://static.rerun.io/rgbd_dataset', # Base data link for rgbd dataset.
89
+ 'https://storage.googleapis.com/', # Storage API entrypoint, not a link.
90
+
91
+ # Not accessible from CI.
92
+ '.github/workflows/.*.yml', # GitHub action workflows cause issues on CI.
93
+ 'https://stackoverflow.com/.', # Stackoverflow links are no longer accessible from CI.
94
+ 'https://www.tensorflow.org/', # tensorflow.org apparently blocks CI.
95
+ 'https://9p.io/sys/doc/lexnames.html', # Works locally but on ci we get: `Failed: Network error: error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:ssl/statem/extensions.c:946:`
96
+
97
+ # Need GitHub login.
98
+ 'https://github.com/rerun-io/landing',
99
+ 'https://github.com/rerun-io/documentation',
100
+
101
+ # Temporarily down or not accessible.
102
+ 'https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html', # Nyud links are down every now and then.
103
+ 'https://eigen.tuxfamily.org/', # Website down https://gitlab.com/libeigen/eigen/-/issues/2804
104
+ 'https://github.com/rerun-io/rerun/releases/download/prerelease', # Pre-release downloads may go down while a pre-release updates or pre-release CI partially breaks.
105
+
106
+ # Works but is really slow at times:
107
+ 'https://openaccess.thecvf.com/content/CVPR2023/html/Du_Learning_To_Render_Novel_Views_From_Wide-Baseline_Stereo_Pairs_CVPR_2023_paper.html',
108
+ 'https://anaconda.org/conda-forge/arrow-cpp',
109
+
110
+ #'^file:///', # Ignore local file links. They need to be tested, but it's useful for external links we have to ping.
111
+ ]
pixi.lock ADDED
The diff for this file is too large to render. See raw diff
 
pixi.toml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pixi is a package management tool for developers.
2
+ # Before running a task, pixi ensures that all listed dependencies are installed first.echop
3
+ #
4
+ # Pixi is not required for rerun, but it is a convenient way to install the
5
+ # dependencies required for this example.
6
+ #
7
+ # https://prefix.dev/docs/pixi/overview
8
+ #
9
+ # Use `pixi task list` to list the available tasks,
10
+ # and `pixi run TASK` to run it (e.g. `pixi run example`).
11
+
12
+ [project]
13
+ name = "rerun_template" # TODO
14
+ authors = ["rerun.io <[email protected]>"]
15
+ channels = ["conda-forge"]
16
+ description = "rerun_template" # TODO
17
+ homepage = "https://rerun.io"
18
+ license = "MIT OR Apache-2.0"
19
+
20
+ platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"]
21
+ readme = "README.md"
22
+ repository = "https://github.com/rerun-io/rerun_template" # TODO
23
+ version = "0.1.0"
24
+
25
+
26
+ [tasks]
27
+ # ------------------------------------------------------------------------------------------
28
+ # C++ stuff:
29
+ # Note: extra CLI argument after `pixi run TASK` are passed to the task cmd.
30
+
31
+ # Clean C++ build artifacts
32
+ clean = { cmd = "rm -rf build bin CMakeFiles/" }
33
+ print-env = { cmd = "echo $PATH" }
34
+ prepare = "cmake -G 'Ninja' -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo"
35
+
36
+ # Build C++ example
37
+ build = { cmd = "cmake --build build --config RelWithDebInfo --target all", depends_on = [
38
+ "prepare",
39
+ ] }
40
+
41
+ # Run C++ example
42
+ example = { cmd = "build/rerun_template", depends_on = ["build"] }
43
+
44
+ # Format C++ code
45
+ cpp-fmt = { cmd = "clang-format -i src/*.[hc]pp" }
46
+
47
+ # Check formatting of C++ code
48
+ cpp-fmt-check = { cmd = "clang-format --dry-run --Werror -i src/*.[hc]pp" }
49
+
50
+ # ------------------------------------------------------------------------------------------
51
+ # Python stuff:
52
+
53
+ # Run first ruff fix, then ruff format, order is important see also https://twitter.com/charliermarsh/status/1717229721954799727
54
+ py-fmt = "ruff check --fix --config pyproject.toml . && ruff format --config pyproject.toml ."
55
+ py-fmt-check = "ruff check --config pyproject.toml . && ruff format --check --config pyproject.toml"
56
+ py-lint = "mypy --install-types --non-interactive --no-warn-unused-ignore"
57
+
58
+ [dependencies]
59
+ # C++ build-tools:
60
+ cmake = "3.27.6"
61
+ clang-tools = ">=15,<16" # clang-format
62
+ cxx-compiler = "1.6.0.*"
63
+ ninja = "1.11.1"
64
+
65
+ # Python stuff:
66
+ mypy = "1.8.0"
67
+ ruff = "0.3.7"
68
+
69
+ types-requests = ">=2.31,<3" # mypy type hint stubs for generate_changelog.py
pyproject.toml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+
3
+ [tool.ruff]
4
+ # https://beta.ruff.rs/docs/configuration/
5
+
6
+ target-version = "py38"
7
+
8
+ # Enable unsafe fixes to allow ruff to apply fixes that may change the behavior of the code.
9
+ # This is needed because otherwise ruff will not be able to trim whitespaces in (codegened) docstrings.
10
+ unsafe-fixes = true
11
+
12
+ # Allow preview lints to be enabled (like `PLW1514` to force `encoding` on open).
13
+ preview = true
14
+ # But we only want to opt-in to certain preview rules!
15
+ lint.explicit-preview-rules = true
16
+
17
+ extend-exclude = [
18
+ # Automatically generated test artifacts
19
+ "venv/",
20
+ "target/",
21
+ ]
22
+
23
+ lint.ignore = [
24
+ # Missing docstring in public function - TODO(emilk): enable for SDK but not for examples
25
+ "D1",
26
+
27
+ # No blank lines allowed after function docstring.
28
+ "D202",
29
+
30
+ # npydocstyle: http://www.pydocstyle.org/en/stable/error_codes.html
31
+ # numpy convention with a few additional lints
32
+ "D107",
33
+ "D203",
34
+ "D212",
35
+ "D401",
36
+ "D402",
37
+ "D415",
38
+ "D416",
39
+
40
+ # Ruff can't fix this error on its own (yet)
41
+ # Having ruff check this causes errors that prevent the code-formatting process from completing.
42
+ "E501",
43
+
44
+ # allow relative imports
45
+ "TID252",
46
+
47
+ "UP007", # We need this, or `ruff format` will convert `Union[X, Y]` to `X | Y` which break on Python 3.8
48
+ ]
49
+
50
+ line-length = 120
51
+ lint.select = [
52
+ "D", # pydocstyle codes https://www.pydocstyle.org/en/latest/error_codes.html
53
+ "E", # pycodestyle error codes: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
54
+ "F", # Flake8 error codes https://flake8.pycqa.org/en/latest/user/error-codes.html
55
+ "I", # Isort
56
+ "TID", # flake8-tidy-imports
57
+ "W", # pycodestyle warning codes: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
58
+ "UP", # pyupgrade (ensures idomatic code for supported python version)
59
+ "PLW1514", # Force setting `encoding` for open calls. This is in order to prevent issues when opening utf8 files on windows where the default encoding may depend on the active locale. https://docs.astral.sh/ruff/rules/unspecified-encoding/
60
+ ]
61
+
62
+ lint.unfixable = [
63
+ "PLW1514", # Automatic fix for `encoding` doesn't do what we want - it queries the locale for the preferred encoding which is exactly what we want to avoid.
64
+ ]
65
+
66
+ [tool.ruff.lint.per-file-ignores]
67
+ "__init__.py" = ["F401", "F403"]
68
+
69
+ [tool.ruff.lint.isort]
70
+ required-imports = ["from __future__ import annotations"]
rust-toolchain ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # If you see this, run "rustup self update" to get rustup 1.23 or newer.
2
+
3
+ # NOTE: above comment is for older `rustup` (before TOML support was added),
4
+ # which will treat the first line as the toolchain name, and therefore show it
5
+ # to the user in the error, instead of "error: invalid channel name '[toolchain]'".
6
+
7
+ [toolchain]
8
+ channel = "1.76.0"
9
+ components = ["rustfmt", "clippy"]
10
+ targets = ["wasm32-unknown-unknown"]
scripts/clippy_wasm/clippy.toml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copied from https://github.com/rerun-io/rerun_template
2
+
3
+ # This is used by the CI so we can forbid some methods that are not available in wasm.
4
+ #
5
+ # We cannot forbid all these methods in the main `clippy.toml` because of
6
+ # https://github.com/rust-lang/rust-clippy/issues/10406
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # Section identical to the main clippy.toml:
10
+
11
+ msrv = "1.76"
12
+
13
+ allow-unwrap-in-tests = true
14
+
15
+ # https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#avoid-breaking-exported-api
16
+ # We want suggestions, even if it changes public API.
17
+ avoid-breaking-exported-api = false
18
+
19
+ excessive-nesting-threshold = 8
20
+
21
+ max-fn-params-bools = 1
22
+
23
+ # https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file
24
+ max-include-file-size = 1000000
25
+
26
+ too-many-lines-threshold = 200
27
+
28
+ # -----------------------------------------------------------------------------
29
+
30
+ # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
31
+ disallowed-methods = [
32
+ { path = "crossbeam::channel::Receiver::into_iter", reason = "Cannot block on Web" },
33
+ { path = "crossbeam::channel::Receiver::iter", reason = "Cannot block on Web" },
34
+ { path = "crossbeam::channel::Receiver::recv_timeout", reason = "Cannot block on Web" },
35
+ { path = "crossbeam::channel::Receiver::recv", reason = "Cannot block on Web" },
36
+ { path = "poll_promise::Promise::block_and_take", reason = "Cannot block on Web" },
37
+ { path = "poll_promise::Promise::block_until_ready_mut", reason = "Cannot block on Web" },
38
+ { path = "poll_promise::Promise::block_until_ready", reason = "Cannot block on Web" },
39
+ { path = "rayon::spawn", reason = "Cannot spawn threads on wasm" },
40
+ { path = "std::sync::mpsc::Receiver::into_iter", reason = "Cannot block on Web" },
41
+ { path = "std::sync::mpsc::Receiver::iter", reason = "Cannot block on Web" },
42
+ { path = "std::sync::mpsc::Receiver::recv_timeout", reason = "Cannot block on Web" },
43
+ { path = "std::sync::mpsc::Receiver::recv", reason = "Cannot block on Web" },
44
+ { path = "std::thread::spawn", reason = "Cannot spawn threads on wasm" },
45
+ { path = "std::time::Duration::elapsed", reason = "use `web-time` crate instead for wasm/web compatibility" },
46
+ { path = "std::time::Instant::now", reason = "use `web-time` crate instead for wasm/web compatibility" },
47
+ { path = "std::time::SystemTime::now", reason = "use `web-time` or `time` crates instead for wasm/web compatibility" },
48
+ ]
49
+
50
+ # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
51
+ disallowed-types = [
52
+ { path = "instant::SystemTime", reason = "Known bugs. Use web-time." },
53
+ { path = "std::thread::Builder", reason = "Cannot spawn threads on wasm" },
54
+ # { path = "std::path::PathBuf", reason = "Can't read/write files on web" }, // Used in build.rs files (which is fine).
55
+ ]
56
+
57
+ # Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
58
+ doc-valid-idents = [
59
+ # You must also update the same list in the root `clippy.toml`!
60
+ "..",
61
+ "GitHub",
62
+ "GLB",
63
+ "GLTF",
64
+ "iOS",
65
+ "macOS",
66
+ "NaN",
67
+ "OBJ",
68
+ "OpenGL",
69
+ "PyPI",
70
+ "sRGB",
71
+ "sRGBA",
72
+ "WebGL",
73
+ "WebSocket",
74
+ "WebSockets",
75
+ ]
scripts/generate_changelog.py ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Copied from https://github.com/rerun-io/rerun_template
3
+
4
+ """
5
+ Summarizes recent PRs based on their GitHub labels.
6
+
7
+ The result can be copy-pasted into CHANGELOG.md,
8
+ though it often needs some manual editing too.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import argparse
14
+ import multiprocessing
15
+ import os
16
+ import re
17
+ import sys
18
+ from dataclasses import dataclass
19
+ from typing import Any, Optional
20
+
21
+ import requests
22
+ from git import Repo # pip install GitPython
23
+ from tqdm import tqdm
24
+
25
+ OWNER = "rerun-io"
26
+ REPO = "rerun_template" # TODO: Change this to the name of the repo
27
+ INCLUDE_LABELS = False # It adds quite a bit of visual noise
28
+ OFFICIAL_RERUN_DEVS = [
29
+ "abey79",
30
+ "emilk",
31
+ "jleibs",
32
+ "jprochazk",
33
+ "nikolausWest",
34
+ "teh-cmc",
35
+ "Wumpf",
36
+ ]
37
+
38
+
39
+ @dataclass
40
+ class PrInfo:
41
+ gh_user_name: str
42
+ pr_title: str
43
+ labels: list[str]
44
+
45
+
46
+ @dataclass
47
+ class CommitInfo:
48
+ hexsha: str
49
+ title: str
50
+ pr_number: Optional[int]
51
+
52
+
53
+ def get_github_token() -> str:
54
+ token = os.environ.get("GH_ACCESS_TOKEN", "")
55
+ if token != "":
56
+ return token
57
+
58
+ home_dir = os.path.expanduser("~")
59
+ token_file = os.path.join(home_dir, ".githubtoken")
60
+
61
+ try:
62
+ with open(token_file, encoding="utf8") as f:
63
+ token = f.read().strip()
64
+ return token
65
+ except Exception:
66
+ pass
67
+
68
+ print("ERROR: expected a GitHub token in the environment variable GH_ACCESS_TOKEN or in ~/.githubtoken")
69
+ sys.exit(1)
70
+
71
+
72
+ # Slow
73
+ def fetch_pr_info_from_commit_info(commit_info: CommitInfo) -> Optional[PrInfo]:
74
+ if commit_info.pr_number is None:
75
+ return None
76
+ else:
77
+ return fetch_pr_info(commit_info.pr_number)
78
+
79
+
80
+ # Slow
81
+ def fetch_pr_info(pr_number: int) -> Optional[PrInfo]:
82
+ url = f"https://api.github.com/repos/{OWNER}/{REPO}/pulls/{pr_number}"
83
+ gh_access_token = get_github_token()
84
+ headers = {"Authorization": f"Token {gh_access_token}"}
85
+ response = requests.get(url, headers=headers)
86
+ json = response.json()
87
+
88
+ # Check if the request was successful (status code 200)
89
+ if response.status_code == 200:
90
+ labels = [label["name"] for label in json["labels"]]
91
+ gh_user_name = json["user"]["login"]
92
+ return PrInfo(gh_user_name=gh_user_name, pr_title=json["title"], labels=labels)
93
+ else:
94
+ print(f"ERROR {url}: {response.status_code} - {json['message']}")
95
+ return None
96
+
97
+
98
+ def get_commit_info(commit: Any) -> CommitInfo:
99
+ match = re.match(r"(.*) \(#(\d+)\)", commit.summary)
100
+ if match:
101
+ title = str(match.group(1))
102
+ pr_number = int(match.group(2))
103
+ return CommitInfo(hexsha=commit.hexsha, title=title, pr_number=pr_number)
104
+ else:
105
+ return CommitInfo(hexsha=commit.hexsha, title=commit.summary, pr_number=None)
106
+
107
+
108
+ def remove_prefix(text: str, prefix: str) -> str:
109
+ if text.startswith(prefix):
110
+ return text[len(prefix) :]
111
+ return text # or whatever
112
+
113
+
114
+ def print_section(crate: str, items: list[str]) -> None:
115
+ if 0 < len(items):
116
+ print(f"#### {crate}")
117
+ for line in items:
118
+ print(f"* {line}")
119
+ print()
120
+
121
+
122
+ def main() -> None:
123
+ parser = argparse.ArgumentParser(description="Generate a changelog.")
124
+ parser.add_argument("--commit-range", help="e.g. 0.1.0..HEAD", required=True)
125
+ args = parser.parse_args()
126
+
127
+ repo = Repo(".")
128
+ commits = list(repo.iter_commits(args.commit_range))
129
+ commits.reverse() # Most recent last
130
+ commit_infos = list(map(get_commit_info, commits))
131
+
132
+ pool = multiprocessing.Pool()
133
+ pr_infos = list(
134
+ tqdm(
135
+ pool.imap(fetch_pr_info_from_commit_info, commit_infos),
136
+ total=len(commit_infos),
137
+ desc="Fetch PR info commits",
138
+ )
139
+ )
140
+
141
+ prs = []
142
+ unsorted_commits = []
143
+
144
+ for commit_info, pr_info in zip(commit_infos, pr_infos):
145
+ hexsha = commit_info.hexsha
146
+ title = commit_info.title
147
+ title = title.rstrip(".").strip() # Some PR end with an unnecessary period
148
+ pr_number = commit_info.pr_number
149
+
150
+ if pr_number is None:
151
+ # Someone committed straight to main:
152
+ summary = f"{title} [{hexsha[:7]}](https://github.com/{OWNER}/{REPO}/commit/{hexsha})"
153
+ unsorted_commits.append(summary)
154
+ else:
155
+ # We prefer the PR title if available
156
+ title = pr_info.pr_title if pr_info else title
157
+ labels = pr_info.labels if pr_info else []
158
+
159
+ if "exclude from changelog" in labels:
160
+ continue
161
+ if "typo" in labels:
162
+ # We get so many typo PRs. Let's not flood the changelog with them.
163
+ continue
164
+
165
+ summary = f"{title} [#{pr_number}](https://github.com/{OWNER}/{REPO}/pull/{pr_number})"
166
+
167
+ if INCLUDE_LABELS and 0 < len(labels):
168
+ summary += f" ({', '.join(labels)})"
169
+
170
+ if pr_info is not None:
171
+ gh_user_name = pr_info.gh_user_name
172
+ if gh_user_name not in OFFICIAL_RERUN_DEVS:
173
+ summary += f" (thanks [@{gh_user_name}](https://github.com/{gh_user_name})!)"
174
+
175
+ prs.append(summary)
176
+
177
+ # Clean up:
178
+ for i in range(len(prs)):
179
+ line = prs[i]
180
+ line = line[0].upper() + line[1:] # Upper-case first letter
181
+ prs[i] = line
182
+
183
+ print()
184
+ print(f"Full diff at https://github.com/rerun-io/{REPO}/compare/{args.commit_range}")
185
+ print()
186
+ print_section("PRs", prs)
187
+ print_section("Unsorted commits", unsorted_commits)
188
+
189
+
190
+ if __name__ == "__main__":
191
+ main()
scripts/template_update.py ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Copied from https://github.com/rerun-io/rerun_template
3
+
4
+ """
5
+ The script has two purposes.
6
+
7
+ After using `rerun_template` as a template, run this to clean out things you don't need.
8
+ Use `scripts/template_update.py init --languages cpp,rust,python` for this.
9
+
10
+ Update an existing repository with the latest changes from the template.
11
+ Use `scripts/template_update.py update --languages cpp,rust,python` for this.
12
+
13
+ In either case, make sure the list of languages matches the languages you want to support.
14
+ You can also use `--dry-run` to see what would happen without actually changing anything.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import argparse
20
+ import os
21
+ import shutil
22
+ import tempfile
23
+
24
+ from git import Repo
25
+
26
+ OWNER = "rerun-io"
27
+
28
+ # Files requires by C++, but not by both Python or Rust.
29
+ CPP_FILES = {
30
+ ".clang-format",
31
+ ".github/workflows/cpp.yml",
32
+ "CMakeLists.txt",
33
+ "pixi.lock", # Not needed by Rust
34
+ "pixi.toml", # Not needed by Rust
35
+ "src/main.cpp",
36
+ "src/",
37
+ }
38
+
39
+ # Files requires by Python, but not by both C++ or Rust
40
+ PYTHON_FILES = {
41
+ ".github/workflows/python.yml",
42
+ ".mypy.ini",
43
+ "pixi.lock", # Not needed by Rust
44
+ "pixi.toml", # Not needed by Rust
45
+ "pyproject.toml",
46
+ }
47
+
48
+ # Files requires by Rust, but not by both C++ or Python
49
+ RUST_FILES = {
50
+ ".github/workflows/rust.yml",
51
+ "bacon.toml",
52
+ "Cargo.lock",
53
+ "Cargo.toml",
54
+ "clippy.toml",
55
+ "Cranky.toml",
56
+ "deny.toml",
57
+ "rust-toolchain",
58
+ "scripts/clippy_wasm/",
59
+ "scripts/clippy_wasm/clippy.toml",
60
+ "src/lib.rs",
61
+ "src/main.rs",
62
+ "src/",
63
+ }
64
+
65
+
66
+ def parse_languages(lang_str: str) -> set[str]:
67
+ languages = lang_str.split(",") if lang_str else []
68
+ for lang in languages:
69
+ assert lang in ["cpp", "python", "rust"], f"Unsupported language: {lang}"
70
+ return set(languages)
71
+
72
+
73
+ def calc_deny_set(languages: set[str]) -> set[str]:
74
+ """The set of files to delete/ignore."""
75
+ files_to_delete = CPP_FILES | PYTHON_FILES | RUST_FILES
76
+ if "cpp" in languages:
77
+ files_to_delete -= CPP_FILES
78
+ if "python" in languages:
79
+ files_to_delete -= PYTHON_FILES
80
+ if "rust" in languages:
81
+ files_to_delete -= RUST_FILES
82
+ return files_to_delete
83
+
84
+
85
+ def init(languages: set[str], dry_run: bool) -> None:
86
+ print("Removing all language-specific files not needed for languages {languages}.")
87
+ files_to_delete = calc_deny_set(languages)
88
+ delete_files_and_folder(files_to_delete, dry_run)
89
+
90
+
91
+ def delete_files_and_folder(paths: set[str], dry_run: bool) -> None:
92
+ repo_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
93
+ for path in paths:
94
+ full_path = os.path.join(repo_path, path)
95
+ if os.path.exists(full_path):
96
+ if os.path.isfile(full_path):
97
+ print(f"Removing file {full_path}…")
98
+ if not dry_run:
99
+ os.remove(full_path)
100
+ elif os.path.isdir(full_path):
101
+ print(f"Removing folder {full_path}…")
102
+ if not dry_run:
103
+ shutil.rmtree(full_path)
104
+
105
+
106
+ def update(languages: set[str], dry_run: bool) -> None:
107
+ files_to_ignore = calc_deny_set(languages)
108
+ repo_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
109
+
110
+ with tempfile.TemporaryDirectory() as temp_dir:
111
+ Repo.clone_from("https://github.com/rerun-io/rerun_template.git", temp_dir)
112
+ for root, dirs, files in os.walk(temp_dir):
113
+ for file in files:
114
+ src_path = os.path.join(root, file)
115
+ rel_path = os.path.relpath(src_path, temp_dir)
116
+
117
+ if rel_path.startswith(".git/"):
118
+ continue
119
+ if rel_path.startswith("src/"):
120
+ continue
121
+
122
+ if rel_path in {"README.md", "pixi.lock", "Cargo.lock"}:
123
+ continue
124
+
125
+ if rel_path not in files_to_ignore:
126
+ dest_path = os.path.join(repo_path, rel_path)
127
+
128
+ print(f"Updating {rel_path}…")
129
+ if not dry_run:
130
+ os.makedirs(os.path.dirname(dest_path), exist_ok=True)
131
+ shutil.copy2(src_path, dest_path)
132
+
133
+
134
+ def main() -> None:
135
+ parser = argparse.ArgumentParser(description="Handle the Rerun template.")
136
+ subparsers = parser.add_subparsers(dest="command")
137
+
138
+ init_parser = subparsers.add_parser("init", help="Initialize a new checkout of the template.")
139
+ init_parser.add_argument(
140
+ "--languages", default="", nargs="?", const="", help="The languages to support (e.g. `cpp,python,rust`)."
141
+ )
142
+ init_parser.add_argument("--dry-run", action="store_true", help="Don't actually delete any files.")
143
+
144
+ update_parser = subparsers.add_parser(
145
+ "update", help="Update all existing Rerun repositories with the latest changes from the template"
146
+ )
147
+ update_parser.add_argument(
148
+ "--languages", default="", nargs="?", const="", help="The languages to support (e.g. `cpp,python,rust`)."
149
+ )
150
+ update_parser.add_argument("--dry-run", action="store_true", help="Don't actually delete any files.")
151
+
152
+ args = parser.parse_args()
153
+
154
+ if args.command == "init":
155
+ init(parse_languages(args.languages), args.dry_run)
156
+ elif args.command == "update":
157
+ update(parse_languages(args.languages), args.dry_run)
158
+ else:
159
+ parser.print_help()
160
+ exit(1)
161
+
162
+
163
+ if __name__ == "__main__":
164
+ main()
src/lib.rs ADDED
@@ -0,0 +1 @@
 
 
1
+
src/main.cpp ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #include <cstdio>
2
+
3
+ #include <rerun.hpp>
4
+
5
+ int main(int argc, const char* argv[]) {
6
+ printf("Hello, World!\n");
7
+ return 0;
8
+ }
src/main.rs ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ fn main() {
2
+ println!("Hello, rerun_template!");
3
+ }