Skip to content

only require rustfmt and update_lints for version bumps #1538

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ util/gh-pages/lints.json

# rustfmt backups
*.rs.bk

helper.txt
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions PUBLISH.md
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to have one commit just for the version bump itself,that is the Cargo.tomls and the changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the script to do this for us

- `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`.
23 changes: 23 additions & 0 deletions pre_publish.sh
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions publish.files
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
M Cargo.toml
M CHANGELOG.md
M clippy_lints/Cargo.toml