Skip to content

Commit 6e4e022

Browse files
authored
Merge pull request #585 from epage/template
chore: Adopt _rust template
2 parents e3c1d0b + 3b21c64 commit 6e4e022

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1603
-801
lines changed

.clippy.toml

+12-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
msrv = "1.46"
1+
allow-print-in-tests = true
2+
allow-expect-in-tests = true
3+
allow-unwrap-in-tests = true
4+
allow-dbg-in-tests = true
5+
# disallowed-methods = [
6+
# { path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
7+
# { path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
8+
# { path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
9+
# { path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
10+
# { path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" },
11+
# { path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" },
12+
# ]

.github/dependabot.yml

-10
This file was deleted.

.github/renovate.json5

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
schedule: [
3+
'before 5am on the first day of the month',
4+
],
5+
semanticCommits: 'enabled',
6+
commitMessageLowerCase: 'never',
7+
configMigration: true,
8+
dependencyDashboard: true,
9+
customManagers: [
10+
{
11+
customType: 'regex',
12+
fileMatch: [
13+
'^rust-toolchain\\.toml$',
14+
'Cargo.toml$',
15+
'clippy.toml$',
16+
'\\.clippy.toml$',
17+
'^\\.github/workflows/ci.yml$',
18+
'^\\.github/workflows/rust-next.yml$',
19+
],
20+
matchStrings: [
21+
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
22+
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?STABLE',
23+
],
24+
depNameTemplate: 'STABLE',
25+
packageNameTemplate: 'rust-lang/rust',
26+
datasourceTemplate: 'github-releases',
27+
},
28+
],
29+
packageRules: [
30+
{
31+
commitMessageTopic: 'Rust Stable',
32+
matchManagers: [
33+
'custom.regex',
34+
],
35+
matchDepNames: [
36+
'STABLE',
37+
],
38+
extractVersion: '^(?<version>\\d+\\.\\d+)', // Drop the patch version
39+
schedule: [
40+
'* * * * *',
41+
],
42+
automerge: true,
43+
},
44+
// Goals:
45+
// - Keep version reqs low, ignoring compatible normal/build dependencies
46+
// - Take advantage of latest dev-dependencies
47+
// - Rollup safe upgrades to reduce CI runner load
48+
// - Help keep number of versions down by always using latest breaking change
49+
// - Have lockfile and manifest in-sync
50+
{
51+
matchManagers: [
52+
'cargo',
53+
],
54+
matchDepTypes: [
55+
'build-dependencies',
56+
'dependencies',
57+
],
58+
matchCurrentVersion: '>=0.1.0',
59+
matchUpdateTypes: [
60+
'patch',
61+
],
62+
enabled: false,
63+
},
64+
{
65+
matchManagers: [
66+
'cargo',
67+
],
68+
matchDepTypes: [
69+
'build-dependencies',
70+
'dependencies',
71+
],
72+
matchCurrentVersion: '>=1.0.0',
73+
matchUpdateTypes: [
74+
'minor',
75+
'patch',
76+
],
77+
enabled: false,
78+
},
79+
{
80+
matchManagers: [
81+
'cargo',
82+
],
83+
matchDepTypes: [
84+
'dev-dependencies',
85+
],
86+
matchCurrentVersion: '>=0.1.0',
87+
matchUpdateTypes: [
88+
'patch',
89+
],
90+
automerge: true,
91+
groupName: 'compatible (dev)',
92+
},
93+
{
94+
matchManagers: [
95+
'cargo',
96+
],
97+
matchDepTypes: [
98+
'dev-dependencies',
99+
],
100+
matchCurrentVersion: '>=1.0.0',
101+
matchUpdateTypes: [
102+
'minor',
103+
'patch',
104+
],
105+
automerge: true,
106+
groupName: 'compatible (dev)',
107+
},
108+
],
109+
}

.github/settings.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
description: "⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications). "
5+
homepage: "https://docs.rs/config/latest/config/"
6+
topics: ""
7+
has_issues: true
8+
has_projects: false
9+
has_wiki: false
10+
has_downloads: true
11+
default_branch: main
12+
13+
# Preference: people do clean commits
14+
allow_merge_commit: true
15+
# Backup in case we need to clean up commits
16+
allow_squash_merge: true
17+
# Not really needed
18+
allow_rebase_merge: false
19+
20+
allow_auto_merge: true
21+
delete_branch_on_merge: true
22+
23+
squash_merge_commit_title: "PR_TITLE"
24+
squash_merge_commit_message: "PR_BODY"
25+
merge_commit_message: "PR_BODY"
26+
27+
# labels:
28+
# # Type
29+
# - name: bug
30+
# color: '#b60205'
31+
# description: "Not as expected"
32+
# - name: enhancement
33+
# color: '#1d76db'
34+
# description: "Improve the expected"
35+
# # Flavor
36+
# - name: question
37+
# color: "#cc317c"
38+
# description: "Uncertainty is involved"
39+
# - name: breaking-change
40+
# color: "#e99695"
41+
# - name: good first issue
42+
# color: '#c2e0c6'
43+
# description: "Help wanted!"
44+
45+
# This serves more as documentation.
46+
# Branch protection API was replaced by rulesets but settings isn't updated.
47+
# See https://github.com/repository-settings/app/issues/825
48+
#
49+
# branches:
50+
# - name: main
51+
# protection:
52+
# required_pull_request_reviews: null
53+
# required_conversation_resolution: true
54+
# required_status_checks:
55+
# # Required. Require branches to be up to date before merging.
56+
# strict: false
57+
# contexts: ["CI", "Spell Check with Typos"]
58+
# enforce_admins: false
59+
# restrictions: null

.github/workflows/audit.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Security audit
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- '**/Cargo.toml'
10+
- '**/Cargo.lock'
11+
push:
12+
branches:
13+
- main
14+
15+
env:
16+
RUST_BACKTRACE: 1
17+
CARGO_TERM_COLOR: always
18+
CLICOLOR: 1
19+
20+
concurrency:
21+
group: "${{ github.workflow }}-${{ github.ref }}"
22+
cancel-in-progress: true
23+
24+
jobs:
25+
security_audit:
26+
permissions:
27+
issues: write # to create issues (actions-rs/audit-check)
28+
checks: write # to create check (actions-rs/audit-check)
29+
runs-on: ubuntu-latest
30+
# Prevent sudden announcement of a new advisory from failing ci:
31+
continue-on-error: true
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
- uses: actions-rs/audit-check@v1
36+
with:
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
cargo_deny:
40+
permissions:
41+
issues: write # to create issues (actions-rs/audit-check)
42+
checks: write # to create check (actions-rs/audit-check)
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
checks:
47+
- bans licenses sources
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: EmbarkStudios/cargo-deny-action@v2
51+
with:
52+
command: check ${{ matrix.checks }}
53+
rust-version: stable

0 commit comments

Comments
 (0)