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

Projects
None yet
3 participants
@phansch
Collaborator

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

This comment has been minimized.

Collaborator

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.

Show resolved Hide resolved clippy_dev/src/main.rs Outdated
@oli-obk

oli-obk approved these changes Nov 4, 2018

phansch and others added some commits Nov 4, 2018

RIIR update lints: Add check mode (update_lints.py rewrite complete)
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.

馃弫
Fix false positive in check mode caused by `gen_deprecated`
`gen_deprecated` should never have created the string with linebreaks.

Using a single string broke the check because the changed lines were
different.
Update println! formatting
Co-Authored-By: phansch <dev@phansch.net>

@phansch phansch force-pushed the phansch:riir_update_lints_finish_line branch from a67b2ba to 745a619 Nov 5, 2018

@oli-obk

This comment has been minimized.

Collaborator

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

Merge #3408
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

This comment has been minimized.

Contributor

bors bot commented Nov 5, 2018

@bors bors bot merged commit 745a619 into rust-lang:master Nov 5, 2018

3 checks passed

bors Build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@phansch phansch deleted the phansch:riir_update_lints_finish_line branch Nov 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment