Skip to content

Commit

Permalink
🔄 synced local './' with remote 'sync/rust'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisliebaer committed Aug 17, 2024
1 parent 317589a commit e895149
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 54 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/cargo-deny.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate dependencies
name: cargo-deny

on:
push:
Expand All @@ -10,18 +10,4 @@ on:

jobs:
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources

# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
uses: chrisliebaer/.github/.github/workflows/cargo-deny.yml@sync
13 changes: 13 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: clippy

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
clippy:
uses: chrisliebaer/.github/.github/workflows/clippy.yml@master
13 changes: 13 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: rustfmt

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
rustfmt:
uses: chrisliebaer/.github/.github/workflows/rustfmt.yml@master
5 changes: 5 additions & 0 deletions deny.exceptions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exceptions = [
# ring is using multiple intermangled licenses
{ allow = ["ISC", "OpenSSL"], name = "ring" },
{ allow = ["MPL-2.0"], name = "webpki-roots" },
]
18 changes: 18 additions & 0 deletions deny.patch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[advisories]

ignore = [
# no fix available
"RUSTSEC-2023-0071",
# this one we should actually fix
"RUSTSEC-2024-0363",
]

[sources]
allow-git = [
"https://github.com/serenity-rs/serenity?tag=v0.12.1"
]

[[licenses.clarify]]
name = "ring"
expression = "MIT AND ISC AND OpenSSL"
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
57 changes: 20 additions & 37 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# cargo-deny is really only ever intended to run on the "normal" tier-1 targets
[graph]
targets = [
{ triple = "x86_64-unknown-linux-gnu" },
{ triple = "aarch64-unknown-linux-gnu" },
{ triple = "x86_64-unknown-linux-musl" },
{ triple = "aarch64-apple-darwin" },
{ triple = "x86_64-apple-darwin" },
{ triple = "x86_64-pc-windows-msvc" },
{ triple = "x86_64-unknown-linux-gnu" },
{ triple = "aarch64-unknown-linux-gnu" },
{ triple = "x86_64-unknown-linux-musl" },
{ triple = "aarch64-apple-darwin" },
{ triple = "x86_64-apple-darwin" },
{ triple = "x86_64-pc-windows-msvc" },
]

[advisories]
version = 2
yanked = "deny"

ignore = [
# we are only consuming a tls endpoint
"RUSTSEC-2023-0071"
]

[bans]
multiple-versions = "allow"
wildcards = "deny"
Expand All @@ -28,33 +22,22 @@ unknown-registry = "deny"
unknown-git = "deny"

[licenses]
version = 2
confidence-threshold = 0.93

# the good licenses
allow = [
"MIT",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"Zlib",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"MPL-2.0",
"CC0-1.0",
"OFL-1.1",
]

exceptions = [
{ allow = ["Unicode-DFS-2016"], name = "unicode-ident" },
# ring is using multiple intermangled licenses
{ allow = ["ISC", "OpenSSL"], name = "ring" },
{ allow = ["MPL-2.0"], name = "webpki-roots" }
"MIT",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"Zlib",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"MPL-2.0",
"CC0-1.0",
"OFL-1.1",
]


[[licenses.clarify]]
name = "ring"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]
# semi global exceptions (the stuff I always run into)
# add local exceptions to deny.exceptions.toml
exceptions = [{ allow = ["Unicode-DFS-2016"], crate = "unicode-ident" }]
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "Two"
# general stuff
hide_parse_errors = true # since we sometimes save files with syntax errors
max_width = 130
color = "always"
color = "Always"
edition = "2021"
newline_style = "Unix"
normalize_comments = true
Expand Down

0 comments on commit e895149

Please sign in to comment.