Skip to content

chore: Adopt _rust/main template #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e7b7555
chore: First step
epage Mar 29, 2023
d6b4446
docs: Set changelog base
epage Mar 29, 2023
afeff23
chore(ci): Quote strings in yaml
epage Mar 29, 2023
2768727
chore: Don't set rustflags by default
epage Mar 29, 2023
0838840
chore: Update release process
epage Mar 29, 2023
afd6a45
chore: Use workspace inheritance
epage Mar 29, 2023
037f379
chore(ci): Remove rustfmt/clippy next jobs
epage Mar 29, 2023
d1dd4ae
chore(ci): Expand approved licenses
epage Mar 29, 2023
6c8df60
chore: Include Cargo.lock
epage Mar 30, 2023
fbaab42
chore(deps): update msrv to v1.65.0
renovate[bot] Apr 1, 2023
29b981c
Merge pull request #1 from epage/renovate/rust-1.x
epage Apr 1, 2023
614b0a2
docs(contrib): Remove reference to travis
epage Mar 29, 2023
f7b990b
fix(ci): Fix Renovate regexes
epage Apr 17, 2023
4163ad7
style(ci): Match auto-generated style
epage Apr 17, 2023
563de12
chore(ci): Update stabilidyDays to new syntax
epage Apr 17, 2023
2c4a7f5
chore(ci): Delay Renovate PRs until ready
epage Apr 17, 2023
62401b8
chore(ci): Lower the MSRV churn for template
epage Apr 17, 2023
d99db2e
style(ci): Match auto-generated style
epage Apr 17, 2023
afaba35
chore(ci): Use new minimumReleaseAge field
epage Apr 17, 2023
60a8ec8
chore(ci): Ban for_each
epage Apr 18, 2023
96297f0
chore(ci): Clarify why map_or is banned
epage Apr 18, 2023
716170e
chore(gh): Ban rebase merges
epage Apr 18, 2023
80d4cdd
chore: Remove clippy lint past MSRV (needs 1.67)
epage May 18, 2023
2b6bb28
chore(ci): Catch clippy config failures
epage May 18, 2023
4d44cd7
chore: Update precommit hooks
epage May 19, 2023
d6075a4
chore: Expand update window so more likely to be hit
epage Aug 2, 2023
67eb1d9
chore(ci): Ensure lockfile isn't stale
epage Aug 7, 2023
ba76b8b
chore(ci): Ensure latest deps are good
epage Aug 11, 2023
5286387
chore: Update pre-commit hooks
epage Aug 11, 2023
efe14d6
chore(renovate): Make style consistent
epage Aug 22, 2023
a6ecf92
chore(renovate): Update config
epage Aug 22, 2023
c8624f0
chore(renovate): Update MSRV on release
epage Aug 23, 2023
44604fc
chore(renovate): Try to fix schedule
epage Aug 23, 2023
ff82d69
chore(ci): Don't fail on wildcards
epage Aug 23, 2023
5749aa0
chore: Approve ISC
epage Sep 7, 2023
4173c8f
chore(ci): Don't set patch for MSRV
epage Sep 20, 2023
86c29de
chore(ci): Updaet Renovate schema
epage Sep 26, 2023
ac51f09
chore(ci): Normalize json5 syntax
epage Sep 26, 2023
3057980
README.md 'Crates Status' icon link now uses the Markdown placeholder…
peter-lyons-kehl Sep 30, 2023
cad9b47
README.md list indentation and no bare URLs, as per Markdown Lint VS …
peter-lyons-kehl Sep 30, 2023
6d3f888
chore(deps): update actions/checkout action to v4
renovate[bot] Oct 1, 2023
f97fa94
Merge pull request #8 from epage/renovate/actions-checkout-4.x
epage Oct 1, 2023
8499939
Merge pull request #6 from peter-kehl/readme_use_crates_io_link_place…
epage Oct 2, 2023
74beef5
Merge pull request #7 from peter-kehl/readme_pass_markdown_lint
epage Oct 2, 2023
5e3b324
chore(ci): Ensure MSRV is quoted
epage Oct 5, 2023
5ebe30b
chore(ci): Update pre-commit hooks
epage Oct 26, 2023
598c624
chore(config): migrate config .github/renovate.json5
renovate[bot] Dec 3, 2023
8c836ea
Merge pull request #10 from epage/renovate/migrate-config
epage Dec 4, 2023
60920cd
chore: Adopt '_rust/main' template
epage Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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" },
]
4 changes: 0 additions & 4 deletions .clog.toml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

3 changes: 0 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
schedule: [
'before 5am on the first day of the month',
],
semanticCommits: 'enabled',
configMigration: true,
dependencyDashboard: true,
customManagers: [
{
customType: 'regex',
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: [
'custom.regex',
],
matchPackageNames: [
'rust',
],
minimumReleaseAge: '336 days', // 8 releases * 6 weeks per release * 7 days per week
internalChecksFilter: 'strict',
extractVersion: '^(?<version>\\d+\\.\\d+)', // Drop the patch version
schedule: [
'* * * * *',
],
},
// 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: '>=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: '>=1.0.0',
matchUpdateTypes: [
'minor',
],
automerge: true,
groupName: 'compatible (dev)',
},
],
}
55 changes: 55 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:
description: "Do two directories have different contents?"
homepage: "https://docs.rs/dir-diff"
topics: "fs testing"
has_issues: true
has_projects: false
has_wiki: false
has_downloads: true
default_branch: master

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

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"
- name: enhancement
color: '#1d76db'
description: "Improve the expected"
# Flavor
- name: question
color: "#cc317c"
description: "Uncertainty is involved"
- name: breaking-change
color: "#e99695"
- name: good first issue
color: '#c2e0c6'
description: "Help wanted!"

branches:
- name: master
protection:
required_pull_request_reviews: null
required_conversation_resolution: true
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: false
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
enforce_admins: false
restrictions: null
49 changes: 49 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Security audit

permissions:
contents: read

on:
pull_request:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
push:
branches:
- master

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@v4
- 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@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
rust-version: stable
142 changes: 142 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: CI

permissions:
contents: read

on:
pull_request:
push:
branches:
- master

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
ci:
permissions:
contents: none
name: CI
needs: [test, msrv, docs, rustfmt, clippy]
runs-on: ubuntu-latest
steps:
- name: Done
run: exit 0
test:
name: Test
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
rust: ["stable"]
continue-on-error: ${{ matrix.rust != 'stable' }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo test --no-run --workspace --all-features
- name: Default features
run: cargo test --workspace
- name: All features
run: cargo test --workspace --all-features
- name: No-default features
run: cargo test --workspace --no-default-features
msrv:
name: "Check MSRV: 1.65.0"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.65.0" # MSRV
- uses: Swatinem/rust-cache@v2
- name: Default features
run: cargo check --workspace --all-targets
- name: All features
run: cargo check --workspace --all-targets --all-features
- name: No-default features
run: cargo check --workspace --all-targets --no-default-features
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: "Is lockfile updated?"
run: cargo fetch --locked
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --workspace --all-features --no-deps --document-private-items
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
# Not MSRV because its harder to jump between versions and people are
# more likely to have stable
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
permissions:
security-events: write # to upload sarif results
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.65.0" # MSRV
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install SARIF tools
run: cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv
- name: Install SARIF tools
run: cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv
- name: Check
run: >
cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
| clippy-sarif
| tee clippy-results.sarif
| sarif-fmt
continue-on-error: true
- name: Upload
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: clippy-results.sarif
wait-for-processing: true
- name: Report status
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
Loading