Skip to content

Commit 5d64b81

Browse files
committed
Ensure the correct clippy_lints dependency version.
1 parent f314fa8 commit 5d64b81

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ semver = "0.2.1"
2929
toml = "0.1"
3030
unicode-normalization = "0.1"
3131
quine-mc_cluskey = "0.2.2"
32-
clippy_lints = { version = "0.0.*", path = "clippy_lints" }
32+
# begin automatic update
33+
clippy_lints = { version = "0.0.69", path = "clippy_lints" }
34+
# end automatic update
3335

3436
[dev-dependencies]
3537
compiletest_rs = "0.1.0"

clippy_lints/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[package]
22
name = "clippy_lints"
3+
# begin automatic update
34
version = "0.0.69"
5+
# end automatic update
46
authors = [
57
"Manish Goregaokar <[email protected]>",
68
"Andre Bogus <[email protected]>",

util/update_lints.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@ def main(print_only=False, check=False):
156156
collect(lints, deprecated_lints, restriction_lints,
157157
os.path.join(root, fn))
158158

159+
# determine version
160+
with open('Cargo.toml') as fp:
161+
for line in fp:
162+
if line.startswith('version ='):
163+
clippy_version = line.split()[2].strip('"')
164+
break
165+
else:
166+
print('Error: version not found in Cargo.toml!')
167+
return
168+
159169
if print_only:
160170
sys.stdout.writelines(gen_table(lints + restriction_lints))
161171
return
@@ -183,6 +193,19 @@ def main(print_only=False, check=False):
183193
key=lambda l: l[1])],
184194
replace_start=False, write_back=not check)
185195

196+
# update version of clippy_lints in Cargo.toml
197+
changed |= replace_region(
198+
'Cargo.toml', r'# begin automatic update', '# end automatic update',
199+
lambda: ['clippy_lints = { version = "%s", path = "clippy_lints" }\n' %
200+
clippy_version],
201+
replace_start=False, write_back=not check)
202+
203+
# update version of clippy_lints in Cargo.toml
204+
changed |= replace_region(
205+
'clippy_lints/Cargo.toml', r'# begin automatic update', '# end automatic update',
206+
lambda: ['version = "%s"\n' % clippy_version],
207+
replace_start=False, write_back=not check)
208+
186209
# update the `pub mod` list
187210
changed |= replace_region(
188211
'clippy_lints/src/lib.rs', r'begin lints modules', r'end lints modules',

0 commit comments

Comments
 (0)