diff --git a/.gitignore b/.gitignore index 33ecb63593cd..7b8050a65633 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ util/gh-pages/lints.json # rustfmt backups *.rs.bk + +helper.txt diff --git a/.travis.yml b/.travis.yml index 8f434f3ef2ae..fa39dd4bed66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,17 +23,11 @@ install: - nvm install stable - nvm use stable - npm install remark-cli remark-lint - # || true, because we cache rustfmt and don't want to crash on the next travis run - # due to rustfmt already being installed - - (cargo install rustfmt || true) script: - PATH=$PATH:./node_modules/.bin - remark -f README.md > /dev/null - - python util/update_lints.py -c - set -e - - PATH=$PATH:~/.cargo/bin cargo fmt -- --write-mode=diff - - cd clippy_lints && PATH=$PATH:~/.cargo/bin cargo fmt -- --write-mode=diff && cd .. - cargo build --features debugging - cargo test --features debugging - mkdir -p ~/rust/cargo/bin diff --git a/PUBLISH.md b/PUBLISH.md index b500e5e3f28c..228e4b97f49a 100644 --- a/PUBLISH.md +++ b/PUBLISH.md @@ -1,15 +1,14 @@ Steps to publish a new clippy version -1. `cargo test`. - Bump `package.version` in `./Cargo.toml` (no need to manually bump `dependencies.clippy_lints.version`). -- Run `./util/update_lints.py`. +- Run `./pre_publish.sh` - Write a changelog entry. -- Commit `./Cargo.toml`, `./clippy_lints/Cargo.toml` and `./CHANGELOG.md`. +- Review and commit all changed files - `git push` - Wait for Travis's approval. - Merge. - `cargo publish` in `./clippy_clints`. - `cargo publish` in the root directory. - `git pull`. -- `git tag -s v0.0.X`. +- `git tag -s v0.0.X -m "v0.0.X"`. - `git push --tags`. diff --git a/pre_publish.sh b/pre_publish.sh new file mode 100755 index 000000000000..ee8e51cda6b7 --- /dev/null +++ b/pre_publish.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +./util/update_lints.py + +git status --short | sort | grep -v README.md | grep -v helper.txt > helper.txt + +# abort if the files differ +diff "publish.files" "helper.txt" + +rm helper.txt + +# add all changed files +git add . +git commit -m "Bump the version" + +set +e + +cd clippy_lints && cargo fmt -- --write-mode=overwrite && cd .. +cargo fmt -- --write-mode=overwrite + +echo "remember to add a git tag and running 'cargo test' before committing the rustfmt changes" diff --git a/publish.files b/publish.files new file mode 100644 index 000000000000..9ee50447f99e --- /dev/null +++ b/publish.files @@ -0,0 +1,3 @@ + M Cargo.toml + M CHANGELOG.md + M clippy_lints/Cargo.toml