generated from rerun-io/rerun_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2abd4b8
Showing
40 changed files
with
7,360 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
BasedOnStyle: Google | ||
|
||
# Make it slightly more similar to Rust. | ||
# Based loosely on https://gist.github.com/YodaEmbedding/c2c77dc693d11f3734d78489f9a6eea4 | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: BlockIndent | ||
AllowAllArgumentsOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
BinPackArguments: false | ||
BreakStringLiterals: false | ||
ColumnLimit: 100 | ||
ContinuationIndentWidth: 4 | ||
DerivePointerAlignment: false | ||
EmptyLineBeforeAccessModifier: LogicalBlock | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: true | ||
InsertBraces: true | ||
InsertTrailingCommas: Wrapped | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: All | ||
PointerAlignment: Left | ||
ReflowComments: false | ||
SeparateDefinitionBlocks: Always | ||
SpacesBeforeTrailingComments: 1 | ||
|
||
# Don't change include blocks, we want to control this manually. | ||
# Sorting headers however is allowed as all our headers should be standalone. | ||
IncludeBlocks: Preserve | ||
SortIncludes: CaseInsensitive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* text=auto eol=lf | ||
Cargo.lock linguist-generated=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- | ||
* Keep your PR:s small and focused. | ||
* The PR title is what ends up in the changelog, so make it descriptive! | ||
* If applicable, add a screenshot or gif. | ||
* Do NOT open PR:s from your `main` branch, as that makes it hard for maintainers to test and add commits to your PR. | ||
* Remember to run `cargo fmt` and `cargo clippy`. | ||
* Open the PR as a draft until you have self-reviewed it and it passes CI. | ||
* When you have addressed a PR comment, mark it as resolved. | ||
Please be patient! | ||
--> | ||
|
||
* Closes #ISSUE_NUMBER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Cargo Machete | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
cargo-machete: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Machete | ||
run: cargo install cargo-machete --locked && cargo machete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
|
||
name: C++ | ||
|
||
jobs: | ||
cpp-check: | ||
name: C++ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.26.1 | ||
cache: true | ||
|
||
- run: pixi run build | ||
|
||
- run: pixi run cpp-fmt-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
|
||
# https://github.com/marketplace/actions/require-labels | ||
# Check for existence of labels | ||
# See all our labels at https://github.com/rerun-io/rerun/issues/labels | ||
|
||
name: PR Labels | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- labeled | ||
- unlabeled | ||
|
||
jobs: | ||
label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for a "do-not-merge" label | ||
uses: mheap/github-action-required-labels@v3 | ||
with: | ||
mode: exactly | ||
count: 0 | ||
labels: "do-not-merge" | ||
|
||
- name: Require label "include in changelog" or "exclude from changelog" | ||
uses: mheap/github-action-required-labels@v3 | ||
with: | ||
mode: minimum | ||
count: 1 | ||
labels: "exclude from changelog, include in changelog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
|
||
name: Link checker | ||
|
||
jobs: | ||
link-checker: | ||
name: Check links | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Restore link checker cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .lycheecache | ||
key: cache-lychee-${{ github.sha }} | ||
restore-keys: cache-lychee- | ||
|
||
# Check https://github.com/lycheeverse/lychee on how to run locally. | ||
- name: Link Checker | ||
id: lychee | ||
uses: lycheeverse/[email protected] | ||
with: | ||
fail: true | ||
lycheeVersion: "0.14.3" | ||
# When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually. | ||
args: | | ||
--base . --cache --max-cache-age 1d . "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
|
||
name: C++ | ||
|
||
jobs: | ||
python-check: | ||
name: Python | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.26.1 | ||
cache: true | ||
|
||
- run: pixi run py-fmt-check | ||
|
||
- run: pixi run py-lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
|
||
name: Rust | ||
|
||
env: | ||
RUSTFLAGS: -D warnings | ||
RUSTDOCFLAGS: -D warnings | ||
|
||
jobs: | ||
rust-check: | ||
name: Rust | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
toolchain: 1.80.0 | ||
override: true | ||
|
||
- name: Install packages (Linux) | ||
if: runner.os == 'Linux' && false # TODO: enable if eframe is part of the project, otherwise remove | ||
uses: awalsh128/[email protected] | ||
with: | ||
# some deps used by eframe, if that is part of the project | ||
packages: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev # libgtk-3-dev is used by rfd | ||
version: 1.0 | ||
execute_install_scripts: true | ||
|
||
- name: Set up cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Rustfmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: check --all-features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all-features --all-targets | ||
|
||
- name: check default features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all-targets | ||
|
||
- name: check --no-default-features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --no-default-features --lib --all-targets | ||
|
||
- name: Test doc-tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc --all-features | ||
|
||
- name: cargo doc --lib | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: doc | ||
args: --lib --no-deps --all-features | ||
|
||
- name: cargo doc --document-private-items | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: doc | ||
args: --document-private-items --no-deps --all-features | ||
|
||
- name: Build tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features --no-run | ||
|
||
- name: Run test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features | ||
|
||
- name: Clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets --all-features -- -D warnings | ||
|
||
# --------------------------------------------------------------------------- | ||
|
||
check_wasm: | ||
name: Check wasm32 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: 1.80.0 | ||
target: wasm32-unknown-unknown | ||
override: true | ||
components: clippy | ||
|
||
- name: Set up cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Check wasm32 | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --target wasm32-unknown-unknown --lib | ||
|
||
- name: Clippy wasm32 | ||
env: | ||
CLIPPY_CONF_DIR: "scripts/clippy_wasm" # Use scripts/clippy_wasm/clippy.toml | ||
run: cargo clippy --target wasm32-unknown-unknown --lib -- -D warnings | ||
|
||
# --------------------------------------------------------------------------- | ||
|
||
cargo-deny: | ||
name: Check Rust dependencies (cargo-deny) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 | ||
with: | ||
rust-version: "1.80.0" | ||
log-level: warn | ||
command: check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
|
||
# https://github.com/crate-ci/typos | ||
# Add exceptions to `.typos.toml` | ||
# install and run locally: cargo install typos-cli && typos | ||
|
||
name: Spell Check | ||
on: [pull_request] | ||
|
||
jobs: | ||
run: | ||
name: Spell Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check spelling of entire workspace | ||
uses: crate-ci/typos@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Mac stuff: | ||
.DS_Store | ||
|
||
# C++ build directory | ||
build | ||
|
||
# Rust compile target directories: | ||
target | ||
target_ra | ||
target_wasm | ||
|
||
# https://github.com/lycheeverse/lychee | ||
.lycheecache | ||
|
||
# Pixi environment | ||
.pixi | ||
|
||
# Python stuff: | ||
__pycache__ | ||
.mypy_cache | ||
.ruff_cache | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[mypy] | ||
files = . | ||
exclude = build | ||
namespace_packages = True | ||
show_error_codes = True | ||
strict = True | ||
enable_error_code = redundant-expr, truthy-bool, ignore-without-code | ||
; plugins = numpy.typing.mypy_plugin | ||
ignore_missing_imports = True | ||
no_implicit_reexport = False | ||
disallow_untyped_calls = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# https://github.com/crate-ci/typos | ||
# install: cargo install typos-cli | ||
# run: typos | ||
|
||
[default.extend-words] | ||
teh = "teh" # part of @teh-cmc |
Oops, something went wrong.