Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RIIR update lints: Add check mode (update_lints.py rewrite complete) #3408

Merged
merged 4 commits into from Nov 5, 2018

Conversation

phansch
Copy link
Member

@phansch phansch commented Nov 4, 2018

This finishes up the rewrite of update_lints.py in Rust. More
specifically, this

  • adds the --check flag and handling to clippy_dev
  • tracks file changes over the different calls to replace_region_in_file
  • only writes changes to files if the --check flag is not used
  • runs ./util/dev update_lints --check on CI instead of the old script
  • replaces usage of the update_lints.py script with an error

./util/dev update_lints behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
clippy_lints/src/lib.rs because underscores seem to be sorted
differently in Rust and in Python.

馃弫

cc #2882

@phansch
Copy link
Member Author

phansch commented Nov 4, 2018

Looks like comparing new_lines and old_lines did not do what I think it would do
I'm going add a unit test for that, too.

clippy_dev/src/main.rs Outdated Show resolved Hide resolved
phansch and others added 4 commits November 5, 2018 07:18
This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this

* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error

`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.

馃弫
`gen_deprecated` should never have created the string with linebreaks.

Using a single string broke the check because the changed lines were
different.
Co-Authored-By: phansch <dev@phansch.net>
@phansch phansch force-pushed the riir_update_lints_finish_line branch from a67b2ba to 745a619 Compare November 5, 2018 06:18
@oli-obk
Copy link
Contributor

oli-obk commented Nov 5, 2018

bors r+

let's get this show on the road

bors bot added a commit that referenced this pull request Nov 5, 2018
3408: RIIR update lints: Add check mode (update_lints.py rewrite complete) r=oli-obk a=phansch

This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this

* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error

`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.

馃弫

cc #2882 

Co-authored-by: Philipp Hansch <dev@phansch.net>
Co-authored-by: Philipp Krones <hello@philkrones.com>
@bors
Copy link
Contributor

bors bot commented Nov 5, 2018

Build succeeded

@bors bors bot merged commit 745a619 into rust-lang:master Nov 5, 2018
@phansch phansch deleted the riir_update_lints_finish_line branch November 5, 2018 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants