mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Ensure the correct clippy_lints dependency version.
This commit is contained in:
parent
f314fa8d28
commit
5d64b81787
@ -29,7 +29,9 @@ semver = "0.2.1"
|
||||
toml = "0.1"
|
||||
unicode-normalization = "0.1"
|
||||
quine-mc_cluskey = "0.2.2"
|
||||
clippy_lints = { version = "0.0.*", path = "clippy_lints" }
|
||||
# begin automatic update
|
||||
clippy_lints = { version = "0.0.69", path = "clippy_lints" }
|
||||
# end automatic update
|
||||
|
||||
[dev-dependencies]
|
||||
compiletest_rs = "0.1.0"
|
||||
|
@ -1,6 +1,8 @@
|
||||
[package]
|
||||
name = "clippy_lints"
|
||||
# begin automatic update
|
||||
version = "0.0.69"
|
||||
# end automatic update
|
||||
authors = [
|
||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||
"Andre Bogus <bogusandre@gmail.com>",
|
||||
|
@ -156,6 +156,16 @@ def main(print_only=False, check=False):
|
||||
collect(lints, deprecated_lints, restriction_lints,
|
||||
os.path.join(root, fn))
|
||||
|
||||
# determine version
|
||||
with open('Cargo.toml') as fp:
|
||||
for line in fp:
|
||||
if line.startswith('version ='):
|
||||
clippy_version = line.split()[2].strip('"')
|
||||
break
|
||||
else:
|
||||
print('Error: version not found in Cargo.toml!')
|
||||
return
|
||||
|
||||
if print_only:
|
||||
sys.stdout.writelines(gen_table(lints + restriction_lints))
|
||||
return
|
||||
@ -183,6 +193,19 @@ def main(print_only=False, check=False):
|
||||
key=lambda l: l[1])],
|
||||
replace_start=False, write_back=not check)
|
||||
|
||||
# update version of clippy_lints in Cargo.toml
|
||||
changed |= replace_region(
|
||||
'Cargo.toml', r'# begin automatic update', '# end automatic update',
|
||||
lambda: ['clippy_lints = { version = "%s", path = "clippy_lints" }\n' %
|
||||
clippy_version],
|
||||
replace_start=False, write_back=not check)
|
||||
|
||||
# update version of clippy_lints in Cargo.toml
|
||||
changed |= replace_region(
|
||||
'clippy_lints/Cargo.toml', r'# begin automatic update', '# end automatic update',
|
||||
lambda: ['version = "%s"\n' % clippy_version],
|
||||
replace_start=False, write_back=not check)
|
||||
|
||||
# update the `pub mod` list
|
||||
changed |= replace_region(
|
||||
'clippy_lints/src/lib.rs', r'begin lints modules', r'end lints modules',
|
||||
|
Loading…
Reference in New Issue
Block a user