-
Notifications
You must be signed in to change notification settings - Fork 6
/
Cargo.toml
258 lines (216 loc) · 8.37 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
#============================================================================
# Workspace Configuration
#----------------------------------------------------------------------------
[workspace]
# Use the newer, better feature resolver.
#
# In the future we'll be able to remove this, but for now without it Cargo
# will default to the old resolver.
resolver = "2"
# Members of the workspace.
members = [
"hipcheck",
"hipcheck-macros",
"xtask",
"test-plugins/dummy_rand_data",
"test-plugins/dummy_sha256",
"sdk/rust",
"hipcheck-sdk-macros",
"plugins/git",
"plugins/github",
"plugins/npm",
"plugins/activity",
"plugins/affiliation",
"plugins/binary",
"plugins/churn",
"plugins/entropy",
"plugins/fuzz",
"plugins/identity",
"plugins/linguist",
"plugins/review",
"plugins/typo"]
# Make sure Hipcheck is run with `cargo run`.
#
# This means to use `xtask` with `cargo run` you need to specify the package.
# See `.cargo/config.toml` for how this is done.
default-members = ["hipcheck"]
# Config for 'dist'
[workspace.metadata.dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.25.1"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Which actions to run on pull requests
pr-run-mode = "plan"
# Whether to install an updater program
install-updater = true
# Extra static files to include in each App (path relative to this Cargo.toml's dir)
include = ["config/"]
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Ubuntu build dependencies for `cargo-dist`
[workspace.metadata.dist.dependencies.apt]
protobuf-compiler = "*"
# macOS build dependencies for 'cargo-dist'
[workspace.metadata.dist.dependencies.homebrew]
protobuf = "*"
# Windows build dependencies for `cargo-dist`
[workspace.metadata.dist.dependencies.chocolatey]
protoc = "*"
# The profile that 'cargo dist' will build with
[profile.dist]
# For now this is just the release profile, but with "thin" Link-Time
# Optimization enabled. This performs _some_ LTO and tries to hit the
# right trade-off between the runtime performance improvements of more
# LTO and the compile time cost of doing LTO.
inherits = "release"
lto = "thin"
#============================================================================
# `cargo-release` Configuration
#
# We use `cargo-release` to automate the release process, including creating
# a release commit, tagging it, and publishing to Crates.io.
#----------------------------------------------------------------------------
[workspace.metadata.release]
# Commit message to use when doing a release.
#
# This is in a Conventional Commits format to play nicely with `git-cliff`.
pre-release-commit-message = "chore: Release {{crate_name}}-v{{version}}"
# Whether to use a single commit when releasing versions of multiple
# crates in a workspace.
consolidate-commits = false
#============================================================================
# `git-cliff` Configuration
#
# We use `git-cliff` to help with generating a `CHANGELOG.md` when we
# publish new versions of Hipcheck.
#----------------------------------------------------------------------------
[workspace.metadata.git-cliff.changelog]
header = """
# Hipcheck Changelog
All notable changes to this project will be documented in this file. This
project adheres to [Semantic Versioning].
"""
body = """
{% if version -%}
## [{{ version | split(pat="-") | last | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{%- endif %}
{%- for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
* \
{{ commit.message | split(pat="\n") | first | trim | trim_end_matches(pat=".") }} \
{% if commit.remote.username %}\
by [@{{ commit.remote.username }}]({{ self::remote_user(name=commit.remote.username) }}) \
{%- endif -%} \
{% if commit.remote.pr_number %} \
in [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }})
{%- endif %}
{%- endfor %}
{%- endfor %}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
### New Contributors
{%- endif %}
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* \
[@{{ contributor.username }}]({{ self::remote_user(name=contributor.username) }}) \
made their first contribution \
{%- if contributor.pr_number %} \
in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor %}
{% if version %}
{% if previous.version %}
__Full Changelog__: <{{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}>
{% endif %}
{% endif %}
{% if version -%}
{% if previous.version -%}
[{{ version | split(pat="-") | last | trim_start_matches(pat="v") }}]: \
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/compare/{{ previous.version }}..{{ version }}
{% else -%}
{% set first_commit = "4372390" %}
[{{ version | split(pat="-") | last | trim_start_matches(pat="v") }}]: \
https://github.com/{{ remote.github.owner }}/{{remote.github.repo}}\
/compare/{{ first_commit }}..HEAD
{% endif -%}
{% else -%}
{% if previous.version -%}
[Unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/compare/{{ previous.version }}..HEAD
{% else -%}
{% set first_commit = "4372390" %}
[Unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/compare/{{ first_commit }}..HEAD
{% endif -%}
{% endif -%}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{%- macro remote_user(name) -%}
{%- if name -%}
https://github.com/{{ name | trim_end_matches(pat="[bot]") }}
{%- else -%}
ERROR
{%- endif -%}
{%- endmacro -%}
"""
footer = """
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
"""
# Remove leading and trailing whitespace from the template.
#
# This lets the template use indentation without having that reflected in
# the output.
trim = true
[workspace.metadata.git-cliff.git]
# How to preprocess commit messages before injecting them into the template
# context when making the `CHANGELOG.md`.
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# How to parse and group commit messages.
commit_parsers = [
{ message = "^.*: add", group = "Added" },
{ message = "^.*: support", group = "Added" },
{ message = "^.*: remove", group = "Removed" },
{ message = "^.*: delete", group = "Removed" },
{ message = "^test", group = "Fixed" },
{ message = "^fix", group = "Fixed" },
{ message = "^.*: fix", group = "Fixed" },
{ message = "^.*", group = "Changed" },
]
# Parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# Filter out the commits that are not conventional
filter_unconventional = true
# Process each line of a commit as an individual commit
split_commits = false
# Protect breaking changes from being skipped due to matching a skipping
# commit_parser
protect_breaking_commits = false
# Filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex for matching git tags
tag_pattern = "v[0-9].*"
[workspace.metadata.git-cliff.bump]
features_always_bump_minor = false
# Configures GitHub integration, which lets `git-cliff` augments the
# generated `CHANGELOG.md` with additional GitHub info.
#
# See: https://git-cliff.org/docs/integration/github
[workspace.metadata.git-cliff.remote.github]
# The GitHub owner and repo name.
owner = "mitre"
repo = "hipcheck"
# This integration ALSO requires a GitHub token, which we expect to be
# set with the `GITHUB_TOKEN` environment variable. This token needs
# read permission for the repository, but nothing more.