Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow rerun_template #2

Merged
merged 32 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8629942
Add Cargo.lock to git
emilk Sep 23, 2024
9ce4094
Add `Cargo.lock` to `.gitattributes`
emilk Sep 23, 2024
5a25046
Add `.typos.toml` and fix some typos
emilk Sep 23, 2024
c474138
Add typos CI step
emilk Sep 23, 2024
7b6296e
Add link checker to CI
emilk Sep 23, 2024
0e29d16
Add a PR template
emilk Sep 23, 2024
ff3c267
Add a label checker CI step
emilk Sep 23, 2024
7137b61
Use rust CI step from rerun_template
emilk Sep 23, 2024
b1b358f
Sort dependencies
emilk Sep 23, 2024
4b89b09
Update `Cargo.toml`
emilk Sep 23, 2024
d3463b3
Add a rust-toolchain
emilk Sep 23, 2024
51a9b19
Add cargo deny.toml
emilk Sep 23, 2024
7aa36bf
Add code of conduct
emilk Sep 23, 2024
6e6818d
Update .gitignore
emilk Sep 23, 2024
d555b3d
Add changelog generator
emilk Sep 23, 2024
86927f3
Add script to update from rerun_template
emilk Sep 23, 2024
36ece63
`cargo clippy --fix`
emilk Sep 23, 2024
5e07986
Add clippy.toml
emilk Sep 23, 2024
b51d271
Add back some implicit lifetimes
emilk Sep 23, 2024
228e2fc
Use `.expect()` when failing to convert to JSON
emilk Sep 23, 2024
c109d2b
Use `.to_owned()`
emilk Sep 23, 2024
daa9062
Some manual clippy fixes
emilk Sep 23, 2024
7c95787
Add clippy lints to Cargo.toml
emilk Sep 23, 2024
2d0ff94
Remove some `unwrap`s
emilk Sep 23, 2024
6b8aae7
Ignore dead code in tests
emilk Sep 23, 2024
ca460af
QuickTime is a valid word
emilk Sep 23, 2024
f753aff
Remove dead links
emilk Sep 23, 2024
43e6f31
Remove an `unwrap`
emilk Sep 23, 2024
a5414ea
allow `unwrap_used` in a place where it is fine to do so
emilk Sep 23, 2024
6926080
Enable `clippy::iter_over_hash_type`
emilk Sep 23, 2024
f5e4a2b
Add some vertical spacing
emilk Sep 23, 2024
baaa2e8
Fix typos
emilk Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf
Cargo.lock linguist-generated=false
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
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
34 changes: 34 additions & 0 deletions .github/workflows/labels.yml
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"
34 changes: 34 additions & 0 deletions .github/workflows/links.yml
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/lychee-action@v1.9.0
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"
129 changes: 105 additions & 24 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,131 @@
name: Rust

# Copied from https://github.com/rerun-io/rerun_template
on:
push:
branches: [ master ]
branches:
- "main"
pull_request:
branches: [ master ]
types: [ opened, synchronize ]

name: Rust

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings

jobs:
build:
rust-check:
name: Rust
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
profile: default
toolchain: 1.76.0
override: true
components: rustfmt, clippy

- name: Setup rust smart caching
uses: Swatinem/rust-cache@v1.3.0
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Cargo fmt
- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Cargo clippy
- name: check --all-features
uses: actions-rs/cargo@v1
with:
command: clippy
args: --no-deps -- -D warnings

- name: Cargo build
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: build

- name: Cargo test
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.76.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.76.0"
log-level: warn
command: check
19 changes: 19 additions & 0 deletions .github/workflows/typos.yml
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
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/Cargo.lock
/target
**/*.rs.bk
*.exe
*.pdb
*.mp4
.idea/
.vscode/
!tests/samples/*.mp4
# Mac stuff:
.DS_Store

# Rust compile target directories:
target
target_ra
target_wasm

# https://github.com/lycheeverse/lychee
.lycheecache
16 changes: 16 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://github.com/crate-ci/typos
# install: cargo install typos-cli
# run: typos

[default.extend-words]
# There are some weird words in this repository:
Copy link
Member

Choose a reason for hiding this comment

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

uhm you're sure about this? Some of those looks like straight up typos

Copy link
Member Author

Choose a reason for hiding this comment

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

I am in fact not sure, but I fixed all the typos I dared fix 😅

alignement = "alignement"
ALS = "ALS"
alst = "alst"
CLL = "CLL"
fiel = "fiel"
intialization = "intialization"
numer = "numer"
trak = "trak"
trun = "trun"
truns = "truns"
Loading
Loading