Skip to content

Commit 079ed8b

Browse files
authored
migrate to copier template (#10)
1 parent 5f89c77 commit 079ed8b

8 files changed

+46
-31
lines changed

.copier-answers.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
2+
_commit: v0.1.4
3+
_src_path: git@github.com:quantco/copier-template-pre-commit-mirrors
4+
description: Run `cargo fmt` for formatting rust sources.
5+
entry: cargo fmt --
6+
tool: rust
7+
url: https://github.com/rust-lang/rust

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
reviewers:
8+
- quantco/ci
9+
groups:
10+
dependencies:
11+
patterns:
12+
- "*"

.github/workflows/autoupdate.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Autoupdate
2+
23
on:
34
workflow_dispatch:
45
schedule:
@@ -15,11 +16,9 @@ jobs:
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: Checkout branch
18-
uses: actions/checkout@v3
19-
with:
20-
ref: ${{ github.head_ref }}
19+
uses: actions/checkout@v4
2120
- name: Set up Conda env
22-
uses: mamba-org/setup-micromamba@63849fa5f38bd7edfb2c4b518206ea9eee3502d1
21+
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
2322
with:
2423
environment-file: environment.yml
2524
environment-name: check-env
@@ -32,10 +31,10 @@ jobs:
3231
new_version=$(micromamba list -n check-env "$pkgname" --json | jq -r '.[0].version')
3332
if [[ "$new_version" != "$old_version" ]]; then
3433
sed -i "s/$old_version/$new_version/g" environment.yml
35-
echo "pkgname=$pkgname" >> "$GITHUB_OUTPUT"
36-
echo "new-version=$new_version" >> "$GITHUB_OUTPUT"
34+
echo "pkgname=$pkgname" >> $GITHUB_OUTPUT
35+
echo "new-version=$new_version" >> $GITHUB_OUTPUT
3736
fi
38-
- uses: peter-evans/create-pull-request@0dfc93c1049996241252d9dc45a270b7c12dec6b
37+
- uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
3938
if: steps.versions.outputs.pkgname
4039
with:
4140
commit-message: "Update ${{ steps.versions.outputs.pkgname }} to ${{ steps.versions.outputs.new-version }}"

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88

99
jobs:
@@ -12,11 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout branch
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
ref: ${{ github.head_ref }}
1818
- name: Set up Conda env
19-
uses: mamba-org/setup-micromamba@63849fa5f38bd7edfb2c4b518206ea9eee3502d1
19+
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
2020
with:
2121
environment-file: environment.yml
2222
environment-name: test-env

.github/workflows/keep-alive.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: Keep
22
on:
3-
# pull_request:
43
schedule:
5-
- cron: "0 6 * * SUN" # Once weekly on Sunday @ 0600 UTC
4+
- cron: 0 6 * * SUN
65

76
jobs:
87
keep-alive:
98
name: Alive
109
runs-on: ubuntu-latest
1110
steps:
12-
- uses: actions/checkout@v2
13-
- uses: gautamkrishnar/keepalive-workflow@1b33e4ef553c59eef0e3450666408021f4b0f456
11+
- uses: actions/checkout@v4
12+
- uses: gautamkrishnar/keepalive-workflow@5b3128727d02fe1a892d0a2987517c9ec8ca7425
1413
with:
15-
commit_message: "Ah ah ah, stayin' alive"
14+
commit_message: Ah ah ah, stayin' alive
1615
committer_username: ForrestQuant
17-
committer_email: "forrestquant@users.noreply.github.com"
18-
time_elapsed: 50 # days
16+
committer_email: forrestquant@users.noreply.github.com
17+
time_elapsed: 50 # days

.pre-commit-hooks.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
- id: cargo-fmt-conda
22
name: cargo-fmt-conda
3-
description: "Run 'cargo fmt' for formatting Rust sources"
4-
entry: 'cargo fmt --'
3+
description: 'Run `cargo fmt` for formatting rust sources.'
4+
entry: cargo fmt --
55
language: conda
66
require_serial: false
77
types: [rust]
88
- id: clippy-conda
99
name: clippy-conda
10-
description: "Run 'clippy' to lint Rust sources"
11-
entry: 'cargo clippy --all-targets --all-features --workspace -- -D warnings'
10+
description: 'Run `clippy` to lint rust sources.'
11+
entry: cargo clippy --all-targets --all-features --workspace -- -D warnings
1212
pass_filenames: false
1313
language: conda
1414
require_serial: false

LICENSE.txt LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2019 QuantCo, Inc.
1+
Copyright 2024 QuantCo, Inc.
22

33
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44

README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
rust(-conda) mirror
2-
====================
1+
# rust mirror
32

43
Mirror of rust for pre-commit with conda as a language.
54

6-
For pre-commit: see https://github.com/pre-commit/pre-commit
7-
For rust: see https://github.com/rust-lang/rust
5+
For pre-commit: see [here](https://github.com/pre-commit/pre-commit)
86

9-
### Using ruff with pre-commit and conda:
7+
For rust: see [here](https://github.com/rust-lang/rust)
8+
9+
## Using rust with pre-commit and conda:
1010

1111
Add this to your `.pre-commit-config.yaml`
1212

1313
```yaml
14-
- repo: https://github.com/Quantco/pre-commit-mirrors-rust
14+
- repo: https://github.com/quantco/pre-commit-mirrors-rust
1515
rev: '' # Use the sha / tag you want to point at
1616
hooks:
17-
- id: cargo-fmt-conda
18-
- id: clippy-conda
17+
- id: rust-conda
1918
```
20-

0 commit comments

Comments
 (0)