Skip to content

Commit 3ce09c4

Browse files
committed
Formatting, dependencies, building, etc
1 parent bf83757 commit 3ce09c4

File tree

10 files changed

+99
-65
lines changed

10 files changed

+99
-65
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
incremental = true

.github/dependabot.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
env:
99
CARGO_TERM_COLOR: always
10+
CARGO_INCREMENTAL: false
1011

1112
jobs:
1213
build-test:
@@ -15,16 +16,26 @@ jobs:
1516

1617
matrix:
1718
include:
18-
- os: windows-latest
19-
target: x86_64-pc-windows-msvc
20-
2119
- os: ubuntu-latest
2220
target: x86_64-unknown-linux-gnu
23-
21+
toolchain: stable
22+
- os: ubuntu-latest
23+
target: x86_64-unknown-linux-gnu
24+
toolchain: nightly
2425
- os: macos-latest
2526
target: x86_64-apple-darwin
27+
toolchain: stable
28+
- os: macos-latest
29+
target: x86_64-apple-darwin
30+
toolchain: nightly
31+
- os: windows-latest
32+
target: x86_64-pc-windows-msvc
33+
toolchain: stable
34+
- os: windows-latest
35+
target: x86_64-pc-windows-msvc
36+
toolchain: nightly
2637

27-
name: Build & Test (${{ matrix.target }})
38+
name: Build & Test (${{ matrix.target }} - ${{ matrix.toolchain }})
2839
runs-on: ${{ matrix.os }}
2940

3041
env:
@@ -37,7 +48,7 @@ jobs:
3748
- name: Install Rust toolchain
3849
uses: actions-rs/toolchain@v1
3950
with:
40-
toolchain: stable
51+
toolchain: ${{ matrix.toolchain }}
4152
target: ${{ matrix.target }}
4253
profile: minimal
4354
override: true
@@ -46,7 +57,7 @@ jobs:
4657
if: matrix.target == 'x86_64-unknown-linux-gnu'
4758
uses: actions-rs/toolchain@v1
4859
with:
49-
toolchain: stable
60+
toolchain: ${{ matrix.toolchain }}
5061
target: ${{ matrix.target }}
5162
profile: minimal
5263
override: true

.gitignore

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
# will have compiled files and executables
33
/target/
44

5-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7-
# Cargo.lock
8-
95
# These are backup files generated by rustfmt
106
**/*.rs.bk
117

8+
# Environment variables
9+
*.env
10+
1211
# Log files
1312
*.log
1413

15-
# JetBrains project config folder
14+
# JetBrains project config folder.
1615
.idea
16+
.fleet
17+
18+
# Ignore Vim temporary and swap files.
19+
*.sw?
20+
*~
1721

18-
# Custom config, copied from `default-config.toml`
19-
config.toml
22+
# Ignore nix build output
23+
result

.pre-commit-config.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-merge-conflict
66
- id: check-toml
@@ -14,8 +14,29 @@ repos:
1414
- id: cargo-fmt
1515
name: cargo fmt
1616
entry: cargo fmt --
17-
language: rust
17+
language: system
1818
types: [rust]
19+
pass_filenames: false # This makes it a lot faster
20+
21+
# `actionlint` hook, for verifying correct syntax in GitHub Actions workflows.
22+
# Some additional configuration for `actionlint` can be found in `.github/actionlint.yaml`.
23+
- repo: https://github.com/rhysd/actionlint
24+
rev: v1.7.7
25+
hooks:
26+
- id: actionlint
27+
stages:
28+
# This hook is disabled by default, since it's quite slow.
29+
# To run all hooks *including* this hook, use `uvx pre-commit run -a --hook-stage=manual`.
30+
# To run *just* this hook, use `uvx pre-commit run -a actionlint --hook-stage=manual`.
31+
- manual
32+
args:
33+
- "-ignore=SC2129" # ignorable stylistic lint from shellcheck
34+
- "-ignore=SC2016" # another shellcheck lint: seems to have false positives?
35+
additional_dependencies:
36+
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
37+
# and checks these with shellcheck. This is arguably its most useful feature,
38+
# but the integration only works if shellcheck is installed
39+
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.10.0"
1940

2041
ci:
2142
autofix_commit_msg: |
@@ -26,5 +47,5 @@ ci:
2647
autoupdate_branch: ""
2748
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
2849
autoupdate_schedule: weekly
29-
skip: []
50+
skip: [cargo-fmt]
3051
submodules: false

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"[rust]": {
3-
"editor.defaultFormatter": "rust-lang.rust-analyzer",
3+
"editor.defaultFormatter": "rust-lang.rust-analyzer"
44
},
55
"rust-analyzer.check.command": "clippy",
6-
"rust-analyzer.diagnostics.enable": true,
6+
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
77
"workbench.colorCustomizations": {
88
"editor.inlayHints.fontSize": 14,
99
"editorInlayHint.background": "#00000000",

Cargo.lock

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
serde = { version = "1.0.203", features = [ "derive" ] }
10-
toml = "0.8.14"
9+
serde = { version = "1.0.219", features = [ "derive" ] }
10+
toml = "0.8.20"
1111
color-eyre = "0.6.3"
1212

1313
[profile.dev.package.backtrace]
@@ -19,4 +19,8 @@ path = "src/main.rs"
1919
name = "rust-binary-project-template"
2020

2121
[profile.release]
22-
lto = "thin"
22+
panic = "abort"
23+
codegen-units = 1
24+
lto = true
25+
opt-level = "s"
26+
strip = true

rustfmt.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
edition = "2024"
12
newline_style = "Unix"
23
use_try_shorthand = true
34
use_field_init_shorthand = true
5+
group_imports = "StdExternalCrate"
6+
imports_granularity = "Crate"

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![forbid(unsafe_code)]
12
#![warn(clippy::nursery, clippy::pedantic)]
23
#![allow(clippy::module_name_repetitions, clippy::future_not_send)]
34

0 commit comments

Comments
 (0)