forked from mirrors/gecko-dev
		
	 1c30442333
			
		
	
	
		1c30442333
		
	
	
	
	
		
			
			Add 'use statements with extraneous spaces' tidy check I added simple check routine for 'use statements with extraneous spaces' and codes that breaks the check routine in rust_tidy.rs. * Added a code that using 'use statements with extraneous spaces' code in rust_tidy.rs * Added assertion code in test_tidy.py. * check_rust function in tidy.py now recognizes the simple case in the 'use statements with extraneous spaces'. * Ran tidy check on rust code and modified a code(tests/unit/style/parsing/inherited_text.rs) that is not passing on this new tidy check. TODO: this code has to be refactored to support more general cases, such as tab or newline. - [X] `./mach build -d` does not report any errors - [X] ./mach test-tidy does not report any errors - [X] These changes fix #14898 (github issue number if applicable). - [X] These changes do not require tests because ./mach test-tidy itself is the test for the code. Source-Repo: https://github.com/servo/servo Source-Revision: b34fdf62341a01abb8da021f07071c5eb8b06622 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 7785f02199a3c54165b88801a7e7abdaec43b78e
		
			
				
	
	
		
			66 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
| /* This Source Code Form is subject to the terms of the Mozilla Public
 | |
|  * License, v. 2.0. If a copy of the MPL was not distributed with this
 | |
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 | |
| 
 | |
| use    app_units::Au;
 | |
| use azure::azure_hl::{ AntialiasMode, Color, ColorPattern, CompositionOp };
 | |
| use azure::azure_hl::{AntialiasMode, Color,
 | |
| ColorPattern, CompositionOp};
 | |
| use euclid::size::Size2D;
 | |
| use azure::azure::AzIntSize;
 | |
| use azure::azure::{AzIntSize};
 | |
| 
 | |
| use std;
 | |
| 
 | |
| mod paint_context;
 | |
| pub mod display_list;
 | |
| mod test::{
 | |
| };
 | |
| 
 | |
| extern crate webrender_traits;
 | |
| extern crate style_traits;
 | |
| 
 | |
| #[foo = "bar,baz"]
 | |
| impl test {
 | |
| 
 | |
|     fn test_fun(y:f32)->f32{
 | |
|         let x=5;
 | |
|         x = x-1;
 | |
|         x = x*x;
 | |
|         let z = match y {
 | |
|             1 =>2,
 | |
|             2 => 1,
 | |
|         };
 | |
|         let z = &Vec<T>;
 | |
|         struct Member {
 | |
|             member_name:"Foo"
 | |
|             member_id:5
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     fn test_fun2(y : &String, z : &Vec<f32>, r: &Root<isize>) -> f32 {
 | |
|         let x = true;
 | |
|         x
 | |
|             && x;
 | |
|         if x {
 | |
|              ;
 | |
|         }
 | |
|         else {
 | |
|              ;
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     type Text_Fun3 = fn( i32) -> i32;
 | |
| 
 | |
|     fn test_fun3<Text_Fun3>( y: Text_Fun3) {
 | |
|         let (x, y) = (1, 2) // Should not trigger
 | |
|         test_fun( x);
 | |
|         test_fun (y);
 | |
|     }
 | |
| 
 | |
|     // Should not be triggered
 | |
|     macro_rules! test_macro ( ( $( $fun:ident = $flag:ident ; )* ) => ());
 | |
| 
 | |
|     let var
 | |
|         = "val";
 | |
| }
 |