Skip to content

Commit 7a746cf

Browse files
authored
Initial commit
0 parents  commit 7a746cf

38 files changed

+7276
-0
lines changed

.clang-format

+34
Original file line numberDiff line numberDiff line change
@@ -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

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto eol=lf
2+
Cargo.lock linguist-generated=false

.github/pull_request_template.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!--
2+
* Keep your PR:s small and focused.
3+
* The PR title is what ends up in the changelog, so make it descriptive!
4+
* If applicable, add a screenshot or gif.
5+
* Do NOT open PR:s from your `main` branch, as that makes it hard for maintainers to test and add commits to your PR.
6+
* Remember to run `cargo fmt` and `cargo clippy`.
7+
* Open the PR as a draft until you have self-reviewed it and it passes CI.
8+
* When you have addressed a PR comment, mark it as resolved.
9+
10+
Please be patient!
11+
-->
12+
13+
* Closes #ISSUE_NUMBER

.github/workflows/cpp.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: C++
10+
11+
jobs:
12+
cpp-check:
13+
name: C++
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: prefix-dev/[email protected]
19+
with:
20+
pixi-version: v0.19.0
21+
cache: true
22+
23+
- run: pixi run build
24+
25+
- run: pixi run cpp-fmt-check

.github/workflows/labels.yml

+34
Original file line numberDiff line numberDiff line change
@@ -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

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: Link checker
10+
11+
jobs:
12+
link-checker:
13+
name: Check links
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Restore link checker cache
19+
uses: actions/cache@v3
20+
with:
21+
path: .lycheecache
22+
key: cache-lychee-${{ github.sha }}
23+
restore-keys: cache-lychee-
24+
25+
# Check https://github.com/lycheeverse/lychee on how to run locally.
26+
- name: Link Checker
27+
id: lychee
28+
uses: lycheeverse/[email protected]
29+
with:
30+
fail: true
31+
lycheeVersion: "0.14.3"
32+
# When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually.
33+
args: |
34+
--base . --cache --max-cache-age 1d . "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml"

.github/workflows/python.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: C++
10+
11+
jobs:
12+
python-check:
13+
name: Python
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: prefix-dev/[email protected]
19+
with:
20+
pixi-version: v0.19.0
21+
cache: true
22+
23+
- run: pixi run py-fmt-check
24+
25+
- run: pixi run py-lint

.github/workflows/rust.yml

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: Rust
10+
11+
env:
12+
RUSTFLAGS: -D warnings
13+
RUSTDOCFLAGS: -D warnings
14+
15+
jobs:
16+
rust-check:
17+
name: Rust
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions-rs/toolchain@v1
23+
with:
24+
profile: default
25+
toolchain: 1.76.0
26+
override: true
27+
28+
- name: Install packages (Linux)
29+
if: runner.os == 'Linux' && false # TODO: enable if eframe is part of the project, otherwise remove
30+
uses: awalsh128/[email protected]
31+
with:
32+
# some deps used by eframe, if that is part of the project
33+
packages: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev # libgtk-3-dev is used by rfd
34+
version: 1.0
35+
execute_install_scripts: true
36+
37+
- name: Set up cargo cache
38+
uses: Swatinem/rust-cache@v2
39+
40+
- name: Rustfmt
41+
uses: actions-rs/cargo@v1
42+
with:
43+
command: fmt
44+
args: --all -- --check
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: Clippy
95+
uses: actions-rs/cargo@v1
96+
with:
97+
command: clippy
98+
args: --all-targets --all-features -- -D warnings
99+
100+
# ---------------------------------------------------------------------------
101+
102+
check_wasm:
103+
name: Check wasm32
104+
runs-on: ubuntu-latest
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+
components: clippy
114+
115+
- name: Set up cargo cache
116+
uses: Swatinem/rust-cache@v2
117+
118+
- name: Check wasm32
119+
uses: actions-rs/cargo@v1
120+
with:
121+
command: check
122+
args: --target wasm32-unknown-unknown --lib
123+
124+
- name: Clippy wasm32
125+
env:
126+
CLIPPY_CONF_DIR: "scripts/clippy_wasm" # Use scripts/clippy_wasm/clippy.toml
127+
run: cargo clippy --target wasm32-unknown-unknown --lib -- -D warnings
128+
129+
# ---------------------------------------------------------------------------
130+
131+
cargo-deny:
132+
name: Check Rust dependencies (cargo-deny)
133+
runs-on: ubuntu-latest
134+
steps:
135+
- uses: actions/checkout@v3
136+
- uses: EmbarkStudios/cargo-deny-action@v1
137+
with:
138+
rust-version: "1.76.0"
139+
log-level: warn
140+
command: check

.github/workflows/typos.yml

+19
Original file line numberDiff line numberDiff line change
@@ -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

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
18+
# Python stuff:
19+
__pycache__
20+
.mypy_cache
21+
.ruff_cache
22+
venv

.mypy.ini

+11
Original file line numberDiff line numberDiff line change
@@ -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

+6
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)