Skip to content

Commit b3ddba4

Browse files
authored
Initial commit
0 parents  commit b3ddba4

38 files changed

Lines changed: 2352 additions & 0 deletions

.claude/settings.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
3+
"permissions": {
4+
"allow": [
5+
"Bash(cargo fmt:*)",
6+
"Bash(cargo clippy:*)",
7+
"Bash(cargo build:*)",
8+
"Bash(cargo check:*)",
9+
"Bash(cargo test:*)",
10+
"Bash(cargo doc:*)",
11+
"Bash(cargo run --example:*)",
12+
"Bash(cargo tree:*)",
13+
"Bash(cargo metadata:*)",
14+
"Bash(cargo deny check:*)",
15+
"Bash(git status:*)",
16+
"Bash(git diff:*)",
17+
"Bash(git log:*)",
18+
"Bash(git show:*)",
19+
"Bash(git branch:*)",
20+
"Bash(gh pr view:*)",
21+
"Bash(gh pr diff:*)",
22+
"Bash(gh pr checks:*)",
23+
"Bash(gh run view:*)"
24+
],
25+
"deny": [
26+
"Read(./.env)",
27+
"Read(./.env.local)",
28+
"Bash(cargo publish:*)",
29+
"Bash(git push --force:*)"
30+
]
31+
}
32+
}

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copy this file to `.env` and fill in real values. `.env` is git-ignored and
2+
# must never be committed.
3+
#
4+
# cp .env.example .env
5+
# $EDITOR .env
6+
#
7+
# Document every environment variable the crate, its tests, or its examples
8+
# read — including optional ones — with a placeholder value and a comment
9+
# saying what it is for. `.env.example` is the contract; `.env` is the secret.
10+
11+
# Log filter for the `tracing`/`env_logger` style ecosystem.
12+
# RUST_LOG=info
13+
14+
# Backtraces for local debugging: 1 for a short backtrace, "full" for all frames.
15+
# RUST_BACKTRACE=1
16+
17+
# Example of a credential a live/network-gated test would need. Tests that
18+
# require one must skip cleanly when it is unset.
19+
# EXAMPLE_API_KEY=replace-me
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Bug Report
2+
description: Report behavior that is broken, surprising, or undocumented.
3+
title: "Bug: "
4+
labels: ["bug"]
5+
body:
6+
- type: input
7+
id: version
8+
attributes:
9+
label: Version or commit
10+
placeholder: "0.1.0 or commit SHA"
11+
validations:
12+
required: true
13+
- type: input
14+
id: rust
15+
attributes:
16+
label: Rust toolchain
17+
placeholder: "rustc --version"
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: reproduce
22+
attributes:
23+
label: Reproduction
24+
description: Include minimal code, commands, or a repository link.
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: expected
29+
attributes:
30+
label: Expected behavior
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: actual
35+
attributes:
36+
label: Actual behavior
37+
validations:
38+
required: true
39+
- type: textarea
40+
id: context
41+
attributes:
42+
label: Additional context

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Security reports
4+
url: https://github.com/tinyhumansai/rust-template/security/policy
5+
about: Please do not report vulnerabilities through public issues.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Feature Request
2+
description: Propose a capability, API, or workflow.
3+
title: "Feature: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem
10+
description: What problem or workflow should this address?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposed solution
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: alternatives
21+
attributes:
22+
label: Alternatives considered
23+
- type: textarea
24+
id: context
25+
attributes:
26+
label: Additional context

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Summary
2+
3+
<!-- What changed and why? Keep it to a few sentences. -->
4+
5+
## Related issue
6+
7+
<!-- Closes #123, or "None". -->
8+
9+
## API or behavior changes
10+
11+
<!-- Note public API or behavior changes, and whether they are breaking. Write "None" if there are none. -->
12+
13+
## Validation
14+
15+
Commands actually run, with their outcome:
16+
17+
- [ ] `cargo fmt --all -- --check`
18+
- [ ] `cargo clippy --all-targets --all-features -- -D warnings`
19+
- [ ] `cargo build --all-targets --all-features`
20+
- [ ] `cargo test --all-features`
21+
22+
## Tests
23+
24+
<!-- What tests were added or updated? Note any deliberately untested edge case and why. -->
25+
26+
## Documentation
27+
28+
<!-- Link updated docs, or explain why documentation was not needed. -->
29+
30+
## Checklist
31+
32+
- [ ] The change is focused on one logical change
33+
- [ ] No new `#[allow(...)]`, `#[ignore]`, or relaxed lints
34+
- [ ] No secrets, tokens, or `.env` contents in the diff or the description

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
commit-message:
9+
prefix: "deps"
10+
groups:
11+
# One pull request per week for routine compatible updates; anything
12+
# breaking still arrives as its own reviewable PR.
13+
cargo-minor-and-patch:
14+
update-types:
15+
- minor
16+
- patch
17+
- package-ecosystem: github-actions
18+
directory: /
19+
schedule:
20+
interval: weekly
21+
open-pull-requests-limit: 5
22+
commit-message:
23+
prefix: "ci"
24+
groups:
25+
github-actions:
26+
patterns:
27+
- "*"

.github/workflows/ci.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
# Lint levels live in `[lints]` in Cargo.toml so local and CI runs agree;
16+
# don't add a blanket RUSTFLAGS here.
17+
CARGO_TERM_COLOR: always
18+
19+
jobs:
20+
rust:
21+
name: Rust
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v7
25+
with:
26+
# This job executes repository code (cargo build/test); don't persist
27+
# the token in git config.
28+
persist-credentials: false
29+
submodules: true
30+
31+
- uses: dtolnay/rust-toolchain@stable
32+
with:
33+
components: rustfmt, clippy
34+
35+
- uses: Swatinem/rust-cache@v2
36+
37+
- name: Check formatting
38+
run: cargo fmt --all -- --check
39+
40+
- name: Clippy
41+
run: cargo clippy --all-targets --all-features -- -D warnings
42+
43+
- name: Build
44+
run: cargo build --all-targets --all-features
45+
46+
- name: Test
47+
run: cargo test --all-features
48+
49+
- name: Test default features
50+
run: cargo test
51+
52+
docs:
53+
name: Docs
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v7
57+
with:
58+
persist-credentials: false
59+
submodules: true
60+
61+
- uses: dtolnay/rust-toolchain@stable
62+
63+
- uses: Swatinem/rust-cache@v2
64+
65+
- name: Build documentation
66+
env:
67+
RUSTDOCFLAGS: -D warnings
68+
run: cargo doc --no-deps --all-features
69+
70+
msrv:
71+
name: Minimum supported Rust version
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v7
75+
with:
76+
persist-credentials: false
77+
submodules: true
78+
79+
- name: Read rust-version from Cargo.toml
80+
id: msrv
81+
run: |
82+
set -euo pipefail
83+
msrv="$(cargo metadata --format-version 1 --no-deps \
84+
| jq -r '.packages[0].rust_version')"
85+
if [[ -z "$msrv" || "$msrv" == "null" ]]; then
86+
echo "package.rust-version is not set in Cargo.toml" >&2
87+
exit 1
88+
fi
89+
echo "version=$msrv" >> "$GITHUB_OUTPUT"
90+
91+
- uses: dtolnay/rust-toolchain@master
92+
with:
93+
toolchain: ${{ steps.msrv.outputs.version }}
94+
95+
- uses: Swatinem/rust-cache@v2
96+
97+
- name: Build with the declared MSRV
98+
run: cargo build --all-targets --all-features
99+
100+
supply-chain:
101+
name: Supply chain
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/checkout@v7
105+
with:
106+
persist-credentials: false
107+
submodules: true
108+
109+
- name: Check advisories, licenses, bans, and sources
110+
uses: EmbarkStudios/cargo-deny-action@v2
111+
with:
112+
command: check all

0 commit comments

Comments
 (0)