From ebcb15d6f2120e1a6ecbe2e15249a089d806341b Mon Sep 17 00:00:00 2001 From: Jefry Lagrange Date: Sun, 19 Feb 2017 10:54:59 +0100 Subject: 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 --- python/tidy/servo_tidy/tidy.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/tidy/servo_tidy/tidy.py') 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", 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, Cell>, DOMRefCell>, DOMRefCell> + (r"(\s|:)+Cell", "Banned type Cell detected. Use MutJS instead", no_filter), + (r"(\s|:)+Cell>", "Banned type Cell> detected. Use MutJS> instead", no_filter), + (r"DOMRefCell>", "Banned type DOMRefCell> detected. Use MutJS> instead", no_filter), + (r"DOMRefCell>", "Banned type DOMRefCell> detected. Use MutJS> instead", no_filter), # No benefit to using &Root (r": &Root<", "use &T instead of &Root", no_filter), (r"^&&", "operators should go at the end of the first line", no_filter), -- cgit v1.2.3