about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-13 13:54:53 +0000
committerbors <bors@rust-lang.org>2020-08-13 13:54:53 +0000
commitba363bdbf9e40db1ad5ad63028c9f1a4474e3d58 (patch)
treedc736238a2defe2a57aaa48979766703de4c4d9b
parentd5f5487252535da878f43486e94007d2b2fce142 (diff)
parent9f827abeb0ad8f4e3ed37af462907a31be7f7cdb (diff)
downloadrust-ba363bdbf9e40db1ad5ad63028c9f1a4474e3d58.tar.gz
rust-ba363bdbf9e40db1ad5ad63028c9f1a4474e3d58.zip
Auto merge of #5901 - giraffate:add_reference_to_rustc_dev_guide, r=matthiaskrgr
Add reference to rustc-dev-guide about lint message

I think it would be better to add lint message convention to documentation. I referred to https://github.com/rust-lang/rust-clippy/pull/5888 and https://github.com/rust-lang/rust-clippy/pull/5893.

changelog: none
-rw-r--r--doc/adding_lints.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/adding_lints.md b/doc/adding_lints.md
index 168092f7329..3c782e9b17f 100644
--- a/doc/adding_lints.md
+++ b/doc/adding_lints.md
@@ -295,8 +295,14 @@ impl EarlyLintPass for FooFunctions {
 
 Running our UI test should now produce output that contains the lint message.
 
+According to [the rustc-dev-guide], the text should be matter of fact and avoid
+capitalization and periods, unless multiple sentences are needed.
+When code or an identifier must appear in a message or label, it should be
+surrounded with single acute accents \`.
+
 [check_fn]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html#method.check_fn
 [diagnostics]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/diagnostics.rs
+[the rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/diagnostics.html
 
 ## Adding the lint logic