aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/codegen/gen_syntax.rs4
-rw-r--r--xtask/src/release.rs3
-rw-r--r--xtask/tests/tidy.rs36
3 files changed, 40 insertions, 3 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 200e8aa50..733493fef 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -247,14 +247,14 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> Result<String> {
247 #(#display_impls)* 247 #(#display_impls)*
248 }; 248 };
249 249
250 let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])"); 250 let ast = ast.to_string().replace("T ! [", "T![");
251 251
252 let mut res = String::with_capacity(ast.len() * 2); 252 let mut res = String::with_capacity(ast.len() * 2);
253 253
254 let mut docs = 254 let mut docs =
255 grammar.nodes.iter().map(|it| &it.doc).chain(grammar.enums.iter().map(|it| &it.doc)); 255 grammar.nodes.iter().map(|it| &it.doc).chain(grammar.enums.iter().map(|it| &it.doc));
256 256
257 for chunk in ast.split("# [ pretty_doc_comment_placeholder_workaround ]") { 257 for chunk in ast.split("# [pretty_doc_comment_placeholder_workaround] ") {
258 res.push_str(chunk); 258 res.push_str(chunk);
259 if let Some(doc) = docs.next() { 259 if let Some(doc) = docs.next() {
260 write_doc_comment(&doc, &mut res); 260 write_doc_comment(&doc, &mut res);
diff --git a/xtask/src/release.rs b/xtask/src/release.rs
index 7fa0966aa..3aab29801 100644
--- a/xtask/src/release.rs
+++ b/xtask/src/release.rs
@@ -37,7 +37,8 @@ Release: release:{}[]
37 37
38== Sponsors 38== Sponsors
39 39
40**Become a sponsor:** https://opencollective.com/rust-analyzer/[opencollective.com/rust-analyzer] 40**Become a sponsor:** On https://opencollective.com/rust-analyzer/[OpenCollective] or
41https://github.com/sponsors/rust-analyzer[GitHub Sponsors].
41 42
42== New Features 43== New Features
43 44
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index fd9645c23..02b3afc96 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -50,6 +50,42 @@ fn rust_files_are_tidy() {
50 tidy_docs.finish(); 50 tidy_docs.finish();
51} 51}
52 52
53#[test]
54fn check_merge_commits() {
55 let stdout = run!("git rev-list --merges --invert-grep --author 'bors\\[bot\\]' HEAD~19.."; echo = false)
56 .unwrap();
57 if !stdout.is_empty() {
58 panic!(
59 "
60Merge commits are not allowed in the history.
61
62When updating a pull-request, please rebase your feature branch
63on top of master by running `git rebase master`. If rebase fails,
64you can re-apply your changes like this:
65
66 # Abort in-progress rebase, if any.
67 $ git rebase --abort
68
69 # Make the branch point to the latest commit from master,
70 # while maintaining your local changes uncommited.
71 $ git reset --soft origin/master
72
73 # Commit all changes in a single batch.
74 $ git commit -am'My changes'
75
76 # Push the changes. We did a rebase, so we need `--force` option.
77 # `--force-with-lease` is a more safe (Rusty) version of `--force`.
78 $ git push --force-with-lease
79
80And don't fear to mess something up during a rebase -- you can
81always restore the previous state using `git ref-log`:
82
83https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/#redo-after-undo-local
84"
85 );
86 }
87}
88
53fn deny_clippy(path: &PathBuf, text: &String) { 89fn deny_clippy(path: &PathBuf, text: &String) {
54 if text.contains("[\u{61}llow(clippy") { 90 if text.contains("[\u{61}llow(clippy") {
55 panic!( 91 panic!(