aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy
diff options
context:
space:
mode:
authorJefry Lagrange <jefry.reyes@gmail.com>2017-02-19 10:54:59 +0100
committerJefry Lagrange <jefry.reyes@gmail.com>2017-02-25 15:56:06 +0100
commitebcb15d6f2120e1a6ecbe2e15249a089d806341b (patch)
treed6d3b436e1ba06c5df6b300cdeb96939fae674d1 /python/tidy/servo_tidy
parent26de7c6bc48affbc2087b32649850f0733e567f0 (diff)
downloadservo-ebcb15d6f2120e1a6ecbe2e15249a089d806341b.tar.gz
servo-ebcb15d6f2120e1a6ecbe2e15249a089d806341b.zip
Rewrite the ban-type lint in Python
Delete old rust ban lint and move tests to python tidy Fix ban lint regex and fix test
Diffstat (limited to 'python/tidy/servo_tidy')
-rw-r--r--python/tidy/servo_tidy/tidy.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index ae929d45c3c..c8b398ce8ca 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -549,6 +549,12 @@ def check_rust(file_name, lines):
(r": &Vec<", "use &[T] instead of &Vec<T>", no_filter),
# No benefit over using &str
(r": &String", "use &str instead of &String", no_filter),
+ # There should be any use of banned types:
+ # Cell<JSVal>, Cell<JS<T>>, DOMRefCell<JS<T>>, DOMRefCell<HEAP<T>>
+ (r"(\s|:)+Cell<JSVal>", "Banned type Cell<JSVal> detected. Use MutJS<JSVal> instead", no_filter),
+ (r"(\s|:)+Cell<JS<.+>>", "Banned type Cell<JS<T>> detected. Use MutJS<JS<T>> instead", no_filter),
+ (r"DOMRefCell<JS<.+>>", "Banned type DOMRefCell<JS<T>> detected. Use MutJS<JS<T>> instead", no_filter),
+ (r"DOMRefCell<Heap<.+>>", "Banned type DOMRefCell<Heap<T>> detected. Use MutJS<JS<T>> instead", no_filter),
# No benefit to using &Root<T>
(r": &Root<", "use &T instead of &Root<T>", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter),