File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 69
69
os .path .join ("." , "." ),
70
70
]
71
71
72
+ spec_base_path = "components/script/dom/"
73
+
72
74
73
75
def is_iter_empty (iterator ):
74
76
try :
@@ -525,10 +527,9 @@ def check_json(filename, contents):
525
527
526
528
527
529
def check_spec (file_name , lines ):
528
- base_path = "components/script/dom/"
529
- if base_path not in file_name :
530
+ if spec_base_path not in file_name :
530
531
raise StopIteration
531
- file_name = os .path .relpath (os .path .splitext (file_name )[0 ], base_path )
532
+ file_name = os .path .relpath (os .path .splitext (file_name )[0 ], spec_base_path )
532
533
patt = re .compile ("^\s*\/\/.+" )
533
534
534
535
# Pattern representing a line with a macro
Original file line number Diff line number Diff line change
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ impl SpecLinkMethods for SpecLink {
6
+ fn Test ( & self ) -> f32 {
7
+ 0
8
+ }
9
+ }
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ def test_rust(self):
59
59
self .assertEqual ('use &[T] instead of &Vec<T>' , errors .next ()[2 ])
60
60
self .assertEqual ('use &str instead of &String' , errors .next ()[2 ])
61
61
62
+ def test_spec_link (self ):
63
+ tidy .spec_base_path = "python/tidy_self_test/"
64
+ errors = tidy .collect_errors_for_files (iterFile ('speclink.rs' ), [], [tidy .check_spec ])
65
+ self .assertEqual ('method declared in webidl is missing a comment with a specification link' , errors .next ()[2 ])
66
+
62
67
def test_webidl (self ):
63
68
errors = tidy .collect_errors_for_files (iterFile ('spec.webidl' ), [tidy .check_webidl_spec ], [])
64
69
self .assertEqual ('No specification link found.' , errors .next ()[2 ])
You can’t perform that action at this time.
0 commit comments