mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Merge #5862
5862: Add a test that forbids merge commits r=matklad a=dragfire Fixes #5854 Co-authored-by: dragfire <asem.devajit@gmail.com>
This commit is contained in:
commit
c31a43d360
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
@ -30,6 +30,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
fetch-depth: 5
|
||||||
|
|
||||||
# We need to disable the existing toolchain to avoid updating rust-docs
|
# We need to disable the existing toolchain to avoid updating rust-docs
|
||||||
# which takes a long time. The fastest way to do this is to rename the
|
# which takes a long time. The fastest way to do this is to rename the
|
||||||
|
@ -50,6 +50,20 @@ fn rust_files_are_tidy() {
|
|||||||
tidy_docs.finish();
|
tidy_docs.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check_merge_commits() {
|
||||||
|
let cmd_output =
|
||||||
|
run!("git rev-list --merges --invert-grep --author 'bors\\[bot\\]' HEAD~4.."; echo = false);
|
||||||
|
match cmd_output {
|
||||||
|
Ok(out) => {
|
||||||
|
if !out.is_empty() {
|
||||||
|
panic!("Please rebase your branch on top of master by running `git rebase master`");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => panic!("{}", e),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn deny_clippy(path: &PathBuf, text: &String) {
|
fn deny_clippy(path: &PathBuf, text: &String) {
|
||||||
if text.contains("[\u{61}llow(clippy") {
|
if text.contains("[\u{61}llow(clippy") {
|
||||||
panic!(
|
panic!(
|
||||||
|
Loading…
Reference in New Issue
Block a user