https://github.com/phansch/mend-rs
Clippy for your Pull Requests
https://github.com/phansch/mend-rs
Last synced: 8 months ago
JSON representation
Clippy for your Pull Requests
- Host: GitHub
- URL: https://github.com/phansch/mend-rs
- Owner: phansch
- License: mit
- Created: 2018-10-16T19:00:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-03T11:25:13.000Z (almost 7 years ago)
- Last Synced: 2024-12-27T17:16:20.733Z (over 1 year ago)
- Language: Rust
- Size: 80.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mend-rs
[](https://travis-ci.com/phansch/mend-rs)
## Development
Run `bin/setup` to install all dependencies.
## Dokku/Server stuff
```shell
dokku logs mend-rs -t
```
Need to also set the following ENV variables on the server:
* GH_CLIENT_ID
* GH_CLIENT_SECRET
* DATABASE_URL
You can find them at the bottom of https://github.com/settings/apps/mend-rs
## User Workflow
1. Users sign up with GitHub
2. They see a repo selection screen
3. They select a repo to register PR hook
4. Done, they will see the comments in new PRs
It should only comment on changed or added lines
## Technical Workflow
1. [ ] Register PR hook
1. [ ] On PR, we will receive the hook notification, and start a new docker container with nightly rust + clippy
1. [ ] Run `RUSTFLAGS="-Z unstable-options --error-format=json" cargo +nightly clippy` in container
1. [ ] Somehow get the json back? Maybe via web api? Or maybe through Filesystem?
- mend-rs itself will be compiled on stable (#16)
- mend-rs will require Rust nightly to be installed for json error format (#17)
Check: https://firejail.wordpress.com/
Check clippy-service for dokku/travis deploy setup
## Snippets
```rust
// Rate limit status:
let status = core.run(github.rate_limit().get()).unwrap();
println!("{:#?}", status);
// Stuff:
let f = github.repo("phansch", "rust-clippy").pulls().get(1).review_comments().create(&opts);
let f = github.repo("phansch", "rust-clippy").pulls().get(1).get();
match core.run(f) {
Ok(pr) => println!("{:?}", pr.patch_url),
Err(err) => println!("err {}", err),
}
// ReviewCommentOptions:
let opts = ReviewCommentOptions {
body: "abc".to_string(),
commit_id: "62733ca4cc6e9716b566a809dc3dd88f8b94690e".to_string(),
path: ".travis.yml".to_string(),
position: 5
};
```