Make tidy check that opening and closing braces that begin a line do so with proper alignment.

This commit is contained in:
coalman 2017-04-17 03:45:30 -04:00
parent a754c10e79
commit 57e74542ee
3 changed files with 23 additions and 3 deletions

View file

@ -63,4 +63,13 @@ impl test {
let var
= "val";
fn test_fun4()
{
}
let var = if true {
"true"
} else { // Should not trigger
"false"
} // Should not trigger
}

View file

@ -131,6 +131,8 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('extra space after (', errors.next()[2])
self.assertEqual('extra space after test_fun', errors.next()[2])
self.assertEqual('no = in the beginning of line', errors.next()[2])
self.assertEqual('space before { is not a multiple of 4', errors.next()[2])
self.assertEqual('space before } is not a multiple of 4', errors.next()[2])
self.assertNoMoreErrors(errors)
feature_errors = tidy.collect_errors_for_files(iterFile('lib.rs'), [], [tidy.check_rust], print_text=False)