Skip to content

Commit

Permalink
chore: Adopt '_rust/main' template
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 14, 2023
2 parents 03ce341 + 5286387 commit f60f371
Show file tree
Hide file tree
Showing 20 changed files with 512 additions and 156 deletions.
14 changes: 13 additions & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
msrv = "1.60.0" # MSRV
msrv = "1.65.0" # MSRV
warn-on-all-wildcard-imports = true
allow-expect-in-tests = true
allow-unwrap-in-tests = true
allow-dbg-in-tests = true
disallowed-methods = [
{ path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
{ path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
{ path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
{ path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
{ path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" },
{ path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" },
]
111 changes: 84 additions & 27 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,45 +1,102 @@
{
"schedule": [
"before 3am on the first day of the month"
schedule: [
'before 5am on the first day of the month',
],
"semanticCommits": "enabled",
"configMigration": true,
"packageRules": [
semanticCommits: 'enabled',
configMigration: true,
dependencyDashboard: true,
regexManagers: [
{
fileMatch: [
'^rust-toolchain\\.toml$',
'Cargo.toml$',
'clippy.toml$',
'\\.clippy.toml$',
'^\\.github/workflows/ci.yml$',
'^\\.github/workflows/rust-next.yml$',
],
matchStrings: [
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
],
depNameTemplate: 'rust',
packageNameTemplate: 'rust-lang/rust',
datasourceTemplate: 'github-releases',
},
],
packageRules: [
{
commitMessageTopic: 'MSRV',
matchManagers: [
'regex',
],
matchPackageNames: [
'rust',
],
minimumReleaseAge: "252 days", // 6 releases * 6 weeks per release * 7 days per week
internalChecksFilter: "strict",
},
// Goals:
// - Keep version reqs low, ignoring compatible normal/build dependencies
// - Take advantage of latest dev-dependencies
// - Rollup safe upgrades to reduce CI runner load
// - Help keep number of versions down by always using latest breaking change
// - Have lockfile and manifest in-sync
{
"matchManagers": ["cargo"],
"matchDepTypes": ["build-dependencies", "dependencies"],
"matchCurrentVersion": ">=0.1.0",
"matchUpdateTypes": ["patch"],
"enabled": false,
matchManagers: [
'cargo',
],
matchDepTypes: [
'build-dependencies',
'dependencies',
],
matchCurrentVersion: '>=0.1.0',
matchUpdateTypes: [
'patch',
],
enabled: false,
},
{
"matchManagers": ["cargo"],
"matchDepTypes": ["build-dependencies", "dependencies"],
"matchCurrentVersion": ">=1.0.0",
"matchUpdateTypes": ["minor"],
"enabled": false,
matchManagers: [
'cargo',
],
matchDepTypes: [
'build-dependencies',
'dependencies',
],
matchCurrentVersion: '>=1.0.0',
matchUpdateTypes: [
'minor',
],
enabled: false,
},
{
"matchManagers": ["cargo"],
"matchDepTypes": ["dev-dependencies"],
"matchCurrentVersion": ">=0.1.0",
"matchUpdateTypes": ["patch"],
"automerge": true,
"groupName": "compatible (dev)",
matchManagers: [
'cargo',
],
matchDepTypes: [
'dev-dependencies',
],
matchCurrentVersion: '>=0.1.0',
matchUpdateTypes: [
'patch',
],
automerge: true,
groupName: 'compatible (dev)',
},
{
"matchManagers": ["cargo"],
"matchDepTypes": ["dev-dependencies"],
"matchCurrentVersion": ">=1.0.0",
"matchUpdateTypes": ["minor"],
"automerge": true,
"groupName": "compatible (dev)",
matchManagers: [
'cargo',
],
matchDepTypes: [
'dev-dependencies',
],
matchCurrentVersion: '>=1.0.0',
matchUpdateTypes: [
'minor',
],
automerge: true,
groupName: 'compatible (dev)',
},
],
}
26 changes: 17 additions & 9 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,46 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:
description: Verify Rust TOML parsers
topics: git rust cli
description: "Verify Rust TOML parsers"
homepage: "https://docs.rs/toml-test"
topics: "git rust cli"
has_issues: true
has_projects: false
has_wiki: false
has_downloads: true
default_branch: main

allow_squash_merge: true
# Preference: people do clean commits
allow_merge_commit: true
allow_rebase_merge: true
# Backup in case we need to clean up commits
allow_squash_merge: true
# Not really needed
allow_rebase_merge: false

# Manual: allow_auto_merge: true, see https://github.com/probot/settings/issues/402
allow_auto_merge: true
delete_branch_on_merge: true

squash_merge_commit_title: "PR_TITLE"
squash_merge_commit_message: "PR_BODY"
merge_commit_message: "PR_BODY"

labels:
# Type
- name: bug
color: '#b60205'
description: Not as expected
description: "Not as expected"
- name: enhancement
color: '#1d76db'
description: Improve the expected
description: "Improve the expected"
# Flavor
- name: question
color: "#cc317c"
description: Uncertainty is involved
description: "Uncertainty is involved"
- name: breaking-change
color: "#e99695"
- name: good first issue
color: '#c2e0c6'
description: Help wanted!
description: "Help wanted!"

branches:
- name: main
Expand Down
40 changes: 35 additions & 5 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
name: Security audit

permissions:
contents: read

on:
pull_request:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
schedule:
- cron: '7 7 7 * *'
branches:
- main

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
security_audit:
permissions:
issues: write # to create issues (actions-rs/audit-check)
checks: write # to create check (actions-rs/audit-check)
runs-on: ubuntu-latest
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -21,3 +33,21 @@ jobs:
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

cargo_deny:
permissions:
issues: write # to create issues (actions-rs/audit-check)
checks: write # to create check (actions-rs/audit-check)
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- bans licenses sources
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
rust-version: stable
Loading

0 comments on commit f60f371

Please sign in to comment.