Skip to content

Commit 835f5a3

Browse files
authored
Merge pull request #53 from epage/template
chore: Update from _rust template
2 parents f080676 + 143832a commit 835f5a3

File tree

10 files changed

+120
-16
lines changed

10 files changed

+120
-16
lines changed

.github/renovate.json5

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
commitMessageLowerCase: 'never',
77
configMigration: true,
88
dependencyDashboard: true,
9+
"pre-commit": {
10+
enabled: true
11+
},
912
customManagers: [
1013
{
1114
customType: 'regex',
@@ -25,6 +28,18 @@
2528
packageNameTemplate: 'rust-lang/rust',
2629
datasourceTemplate: 'github-releases',
2730
},
31+
{
32+
customType: 'regex',
33+
managerFilePatterns: [
34+
'/^\\.github/workflows/pre-commit.yml$/',
35+
],
36+
matchStrings: [
37+
'prek-version.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
38+
],
39+
depNameTemplate: 'prek',
40+
packageNameTemplate: 'j178/prek',
41+
datasourceTemplate: 'github-releases',
42+
},
2843
],
2944
packageRules: [
3045
{
@@ -41,6 +56,20 @@
4156
],
4257
automerge: true,
4358
},
59+
{
60+
commitMessageTopic: 'Prek',
61+
matchManagers: [
62+
'custom.regex',
63+
],
64+
matchDepNames: [
65+
'prek',
66+
],
67+
extractVersion: '^(?<version>\\d+\\.\\d+\\.\\d+)',
68+
schedule: [
69+
'* * * * *',
70+
],
71+
automerge: true,
72+
},
4473
// Goals:
4574
// - Keep version reqs low, ignoring compatible normal/build dependencies
4675
// - Take advantage of latest dev-dependencies

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
rust: ["stable"]
3939
continue-on-error: ${{ matrix.rust != 'stable' }}
4040
runs-on: ${{ matrix.os }}
41+
env:
42+
# Reduce amount of data cached
43+
CARGO_PROFILE_DEV_DEBUG: line-tables-only
4144
steps:
4245
- name: Checkout repository
4346
uses: actions/checkout@v6
@@ -53,7 +56,10 @@ jobs:
5356
run: cargo hack test --each-feature --workspace
5457
msrv:
5558
name: "Check MSRV"
56-
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
os: ["ubuntu-latest"]
62+
runs-on: ${{ matrix.os }}
5763
steps:
5864
- name: Checkout repository
5965
uses: actions/checkout@v6
@@ -67,7 +73,10 @@ jobs:
6773
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going
6874
minimal-versions:
6975
name: Minimal versions
70-
runs-on: ubuntu-latest
76+
strategy:
77+
matrix:
78+
os: ["ubuntu-latest"]
79+
runs-on: ${{ matrix.os }}
7180
steps:
7281
- name: Checkout repository
7382
uses: actions/checkout@v6
@@ -123,7 +132,7 @@ jobs:
123132
components: rustfmt
124133
- uses: Swatinem/rust-cache@v2
125134
- name: Check formatting
126-
run: cargo fmt --all -- --check
135+
run: cargo fmt --check
127136
clippy:
128137
name: clippy
129138
runs-on: ubuntu-latest

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v6
26-
- uses: actions/setup-python@v6
26+
- uses: j178/prek-action@v1
2727
with:
28-
python-version: '3.x'
29-
- uses: pre-commit/action@v3.0.1
28+
prek-version: '0.2.27'

.github/workflows/rust-next.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
rust: "nightly"
2929
continue-on-error: ${{ matrix.rust != 'stable' }}
3030
runs-on: ${{ matrix.os }}
31+
env:
32+
# Reduce amount of data cached
33+
CARGO_PROFILE_DEV_DEBUG: line-tables-only
3134
steps:
3235
- name: Checkout repository
3336
uses: actions/checkout@v6
@@ -43,7 +46,12 @@ jobs:
4346
run: cargo hack test --each-feature --workspace
4447
latest:
4548
name: "Check latest dependencies"
46-
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
os: ["ubuntu-latest"]
52+
runs-on: ${{ matrix.os }}
53+
env:
54+
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow
4755
steps:
4856
- name: Checkout repository
4957
uses: actions/checkout@v6

.github/workflows/template.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Template Update
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
schedule:
8+
- cron: '1 1 1 * *'
9+
workflow_dispatch:
10+
11+
env:
12+
RUST_BACKTRACE: 1
13+
CARGO_TERM_COLOR: always
14+
CLICOLOR: 1
15+
TEMPLATE_URL: "https://github.com/epage/_rust.git"
16+
TEMPLATE_BRANCH: "main"
17+
18+
concurrency:
19+
group: "${{ github.workflow }}-${{ github.ref }}"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
update:
24+
permissions:
25+
security-events: write # to create PR
26+
pull-requests: write
27+
contents: write # to push the branch
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
34+
- name: Configure git
35+
run: |
36+
git config --global user.name '${{ github.actor }}'
37+
git config --global user.email '<>'
38+
- name: Fetch template
39+
run: "git remote add template ${{ env.TEMPLATE_URL }} && git fetch template ${{ env.TEMPLATE_BRANCH }}"
40+
- name: Merge template
41+
run: "git checkout -b template-update && git merge template/${{ env.TEMPLATE_BRANCH }} -m 'chore: Update from template'"
42+
- name: Clear any existing branch
43+
run: "git push origin --delete template-update"
44+
continue-on-error: true
45+
env:
46+
GH_TOKEN: ${{ github.token }}
47+
- name: Push branch
48+
run: "git push --set-upstream origin template-update"
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
- name: Create PR
52+
run: "gh pr create --head template-update --title 'chore: Update from template' --body ''"
53+
env:
54+
GH_TOKEN: ${{ github.token }}
55+
- name: Merge PR
56+
run: "gh pr merge --auto --delete-branch"
57+
env:
58+
GH_TOKEN: ${{ github.token }}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default_install_hook_types: ["pre-commit", "commit-msg"]
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v5.0.0
4+
rev: v6.0.0
55
hooks:
66
- id: check-yaml
77
- id: check-json
@@ -10,10 +10,10 @@ repos:
1010
- id: check-case-conflict
1111
- id: detect-private-key
1212
- repo: https://github.com/crate-ci/typos
13-
rev: v1.32.0
13+
rev: v1.42.1
1414
hooks:
1515
- id: typos
1616
- repo: https://github.com/crate-ci/committed
17-
rev: v1.1.7
17+
rev: v1.1.10
1818
hooks:
1919
- id: committed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5-
and this project adheres to [Semantic Versioning](http://semver.org/).
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/)
5+
and this project adheres to [Semantic Versioning](https://semver.org/).
66

77
<!-- next-header -->
88
## [Unreleased] - ReleaseDate

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ create_dir = "warn"
3434
dbg_macro = "warn"
3535
debug_assert_with_mut_call = "warn"
3636
doc_markdown = "warn"
37-
empty_enum = "warn"
37+
empty_enums = "warn"
3838
enum_glob_use = "warn"
3939
expl_impl_clone_on_copy = "warn"
4040
explicit_deref_methods = "warn"
@@ -78,7 +78,6 @@ str_to_string = "warn"
7878
string_add = "warn"
7979
string_add_assign = "warn"
8080
string_lit_as_bytes = "warn"
81-
string_to_string = "warn"
8281
todo = "warn"
8382
trait_duplication_in_bounds = "warn"
8483
uninlined_format_args = "warn"
@@ -111,7 +110,7 @@ include.workspace = true
111110

112111
[package.metadata.docs.rs]
113112
all-features = true
114-
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
113+
rustdoc-args = ["--generate-link-to-definition"]
115114

116115
[package.metadata.release]
117116
pre-release-replacements = [

deny.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ allow = [
9191
"BSD-3-Clause",
9292
"MPL-2.0",
9393
"Unicode-DFS-2016",
94+
"Unicode-3.0",
9495
"CC0-1.0",
9596
"ISC",
9697
"OpenSSL",
9798
"Zlib",
99+
"NCSA",
98100
]
99101
# The confidence threshold for detecting a license from license text.
100102
# The higher the value, the more closely the license text must be to the

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
22
#![warn(clippy::print_stderr)]
33
#![warn(clippy::print_stdout)]
44

0 commit comments

Comments
 (0)