aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy/tidy.py
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-12-16 11:36:47 -0500
committerJosh Matthews <josh@joshmatthews.net>2016-12-16 11:52:45 -0500
commit14d8ae2478356014a4ab10fbed1b11b3616475a4 (patch)
tree92932abd86ec4af78cbcc3f8414ac71bb4d6115a /python/tidy/servo_tidy/tidy.py
parenta74cbbeb1a112dda2a18327ee0c9d4caad2ec277 (diff)
downloadservo-14d8ae2478356014a4ab10fbed1b11b3616475a4.tar.gz
servo-14d8ae2478356014a4ab10fbed1b11b3616475a4.zip
Add a tidy check for problematic match cases in script_thread.rs
Diffstat (limited to 'python/tidy/servo_tidy/tidy.py')
-rw-r--r--python/tidy/servo_tidy/tidy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index b40bdd67194..7855d4c7a50 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -542,6 +542,9 @@ def check_rust(file_name, lines):
lambda match, line: line.startswith('use ')),
(r"^\s*else {", "else braces should be on the same line", no_filter),
(r"[^$ ]\([ \t]", "extra space after (", no_filter),
+ # This particular pattern is not reentrant-safe in script_thread.rs
+ (r"match self.documents.borrow", "use a separate variable for the match expression",
+ lambda match, line: file_name.endswith('script_thread.rs')),
]
for pattern, message, filter_func in regex_rules: