Automatically verify that derive() lists are alphabetically ordered

This commit is contained in:
Clément DAVID 2017-08-21 22:56:05 +02:00
parent 16c1446137
commit ab73f3d61d
3 changed files with 15 additions and 0 deletions

View file

@ -21,6 +21,7 @@ extern crate webrender_api;
extern crate style_traits;
#[foo = "bar,baz"]
#[derive(Copy,Debug, ComputeSquaredDistance)]
impl test {
fn test_fun(y:f32)->f32{

View file

@ -107,6 +107,7 @@ class CheckTidiness(unittest.TestCase):
self.assertTrue('mod declaration is not in alphabetical order' in errors.next()[2])
self.assertEqual('mod declaration spans multiple lines', errors.next()[2])
self.assertTrue('extern crate declaration is not in alphabetical order' in errors.next()[2])
self.assertTrue('derivable traits list is not in alphabetical order' in errors.next()[2])
self.assertEqual('found an empty line following a {', errors.next()[2])
self.assertEqual('missing space before ->', errors.next()[2])
self.assertEqual('missing space after ->', errors.next()[2])