Skip to content

Commit

Permalink
Import and relicense code from Moire
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jan 17, 2024
0 parents commit 846117e
Show file tree
Hide file tree
Showing 20 changed files with 1,432 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

crate
33 changes: 33 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"rules": {
"subject-min-length": [
2,
"always",
8
],
"subject-max-length": [
2,
"always",
50
],
"subject-case": [
2,
"always",
"sentence-case"
],
"subject-full-stop": [
2,
"never",
"."
],
"body-max-line-length": [
2,
"always",
72
],
"footer-leading-blank": [
2,
"always"
]
}
}
2 changes: 2 additions & 0 deletions .commitlintrc.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: The audio-viz authors
SPDX-License-Identifier: CC0-1.0
29 changes: 29 additions & 0 deletions .deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

[advisories]
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
vulnerability = "deny"
unmaintained = "warn"
yanked = "warn"
notice = "warn"

[licenses]
default = "deny"
unlicensed = "deny"
copyleft = "warn"
allow = [
"Apache-2.0",
"ISC",
"MIT",
"MPL-2.0",
"Unicode-DFS-2016",
]

[bans]
multiple-versions = "warn"
wildcards = "allow"
highlight = "all"
workspace-default-features = "allow"
external-default-features = "allow"
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
37 changes: 37 additions & 0 deletions .github/workflows/dependency-audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

# Same as file name
name: dependency-audit

permissions:
contents: read

on:
push:
paths:
- "**/Cargo.toml"
- ".deny.toml"
schedule:
# Weekly, i.e. on Sunday at 13:37 UTC
- cron: "37 13 * * 0"
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Generate Cargo.lock
run: cargo generate-lockfile

- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
arguments: >-
--all-features
--locked
65 changes: 65 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

# Same as file name
name: pre-commit

permissions:
contents: read

on:
pull_request:
push:
branches:
- "*"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Install ALSA and Jack dependencies
run: >-
sudo apt-get update &&
sudo apt-get install -y
libasound2-dev
libjack-jackd2-dev
libudev-dev
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Check out repository
uses: actions/checkout@v4

- name: Generate Cargo.lock
run: cargo generate-lockfile

- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different workflows and jobs.
shared-key: ${{ github.workflow }}-${{ github.job }}

- name: Detect code style issues (push)
uses: pre-commit/[email protected]
if: github.event_name == 'push'

- name: Detect code style issues (pull_request)
uses: pre-commit/[email protected]
if: github.event_name == 'pull_request'
env:
SKIP: no-commit-to-branch
61 changes: 61 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

# Same as file name
name: test

permissions:
contents: read

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Install ALSA and Jack dependencies
run: >-
sudo apt-get update &&
sudo apt-get install -y
libasound2-dev
libjack-jackd2-dev
libudev-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Check out repository
uses: actions/checkout@v4

- name: Generate Cargo.lock
run: cargo generate-lockfile

- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different workflows and jobs.
shared-key: ${{ github.workflow }}-${{ github.job }}

- name: Check WASM target with default features
run: >-
cargo check --locked --target wasm32-unknown-unknown
- name: Run tests with all features enabled
run: >-
cargo test --locked --all-features
-- --nocapture --quiet
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

# Don't add any custom patterns for platform-specific files like .DS_Store
# or generated by custom development tools like .vscode or .idea that don't
# affect other developers. Instead add those custom patterns to your global
# .gitignore file that can be configured by setting core.excludesFile.
# See also: https://git-scm.com/docs/gitignore

# Cargo artifacts
Cargo.lock

# Build directories (or a symbolic link, i.e. without a trailing slash)
/target
44 changes: 44 additions & 0 deletions .justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

# just manual: https://github.com/casey/just/#readme

_default:
@just --list

# Format source code
fmt:
cargo fmt --all

# Run clippy with various feature combinations
clippy:
cargo clippy --locked --workspace --all-targets --no-default-features
cargo clippy --locked --workspace --all-targets --no-default-features --features all-controllers
cargo clippy --locked --workspace --no-deps --all-targets --all-features -- -D warnings --cap-lints warn

# Run cargo check for the WASM target with default features enabled
check-wasm:
cargo check --locked --workspace --target wasm32-unknown-unknown

# Run unit tests
test:
RUST_BACKTRACE=1 cargo test --locked --all-features -- --nocapture

# Set up (and update) tooling
setup:
# Ignore rustup failures, because not everyone might use it
rustup self update || true
# cargo-edit is needed for `cargo upgrade`
cargo install cargo-edit just
pip install -U pre-commit
#pre-commit install --hook-type commit-msg --hook-type pre-commit

# Upgrade (and update) dependencies
upgrade: setup
pre-commit autoupdate
cargo upgrade --incompatible --pinned
cargo update

# Run pre-commit hooks
pre-commit:
pre-commit run --all-files
41 changes: 41 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: The audio-viz authors
# SPDX-License-Identifier: CC0-1.0

# Disable some built-in rules
config:
default: true

# The same headline in different nested sections is okay (and necessary for
# CHANGELOG.md).
no-duplicate-header:
allow_different_nesting: true

# We use ordered lists to make stuff easier to read in a text editor.
ol-prefix:
style: ordered

# Not wrapping long lines makes diffs easier to read, especially for prose.
# Instead, we should follow the "one sentence per line" pattern.
line-length: false

# Dollar signs are useful to indicate shell commands/type and help
# distinguishing wrapped lines from new commands.
commands-show-output: false

# Indented code blocks are easier to read in a text editor, but don't allow
# specifying a language for syntax highlighting. Therefore both indented and
# fenced code block should be allowed depending on the use case.
code-block-style: false

# MD026/no-trailing-punctuation: Trailing punctuation in heading
# Used in README.md
no-trailing-punctuation: false

# Fix any fixable errors
fix: true

# Disable inline config comments
noInlineConfig: true

# Disable progress on stdout (only valid at root)
noProgress: true
Loading

0 comments on commit 846117e

Please sign in to comment.