aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/lints
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-12 11:06:27 -0600
committerGitHub <noreply@github.com>2016-11-12 11:06:27 -0600
commit290a1696dc6b16c421a40dc08abdc072a2fb4cf2 (patch)
treefcc20a84eb9dc551502ebbddc692f8309ad5b3e1 /python/tidy/servo_tidy_tests/lints
parentf04033a13972faea9efd9689e6949406241ca85f (diff)
parent34955e0bf882efdd61fde3708495fbf75734c8bc (diff)
downloadservo-290a1696dc6b16c421a40dc08abdc072a2fb4cf2.tar.gz
servo-290a1696dc6b16c421a40dc08abdc072a2fb4cf2.zip
Auto merge of #14166 - Wafflespeanut:tidy, r=frewsxcv
Allow tidy to run custom project-specific lints <!-- Please describe your changes on the following line: --> Since tidy is a package, it shouldn't contain our WPT lint. This PR changes the file list generator (we already have) into an object, and allows tidy to run custom python lint scripts (specified in the config file) under the context of `LintRunner`. The errors are then chained into our mechanism. r? @frewsxcv (cc @jdm @edunham @aneeshusa and anyone else interested in reviewing it) --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14166) <!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy_tests/lints')
-rw-r--r--python/tidy/servo_tidy_tests/lints/invalid_error_tuple.py5
-rw-r--r--python/tidy/servo_tidy_tests/lints/no_lint.py5
-rw-r--r--python/tidy/servo_tidy_tests/lints/no_run.py5
-rw-r--r--python/tidy/servo_tidy_tests/lints/not_inherited.py2
-rw-r--r--python/tidy/servo_tidy_tests/lints/not_script0
-rw-r--r--python/tidy/servo_tidy_tests/lints/proper_file.py6
6 files changed, 23 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/lints/invalid_error_tuple.py b/python/tidy/servo_tidy_tests/lints/invalid_error_tuple.py
new file mode 100644
index 00000000000..4851cdf402c
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/lints/invalid_error_tuple.py
@@ -0,0 +1,5 @@
+from servo_tidy.tidy import LintRunner
+
+class Lint(LintRunner):
+ def run(self):
+ yield None
diff --git a/python/tidy/servo_tidy_tests/lints/no_lint.py b/python/tidy/servo_tidy_tests/lints/no_lint.py
new file mode 100644
index 00000000000..e9f84aa9f3c
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/lints/no_lint.py
@@ -0,0 +1,5 @@
+from servo_tidy.tidy import LintRunner
+
+class Linter(LintRunner):
+ def run(self):
+ pass
diff --git a/python/tidy/servo_tidy_tests/lints/no_run.py b/python/tidy/servo_tidy_tests/lints/no_run.py
new file mode 100644
index 00000000000..2acd5db1fee
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/lints/no_run.py
@@ -0,0 +1,5 @@
+from servo_tidy.tidy import LintRunner
+
+class Lint(LintRunner):
+ def some_method(self):
+ pass
diff --git a/python/tidy/servo_tidy_tests/lints/not_inherited.py b/python/tidy/servo_tidy_tests/lints/not_inherited.py
new file mode 100644
index 00000000000..fc38dff2c58
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/lints/not_inherited.py
@@ -0,0 +1,2 @@
+class Lint(object):
+ pass
diff --git a/python/tidy/servo_tidy_tests/lints/not_script b/python/tidy/servo_tidy_tests/lints/not_script
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/lints/not_script
diff --git a/python/tidy/servo_tidy_tests/lints/proper_file.py b/python/tidy/servo_tidy_tests/lints/proper_file.py
new file mode 100644
index 00000000000..acecb82abd4
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/lints/proper_file.py
@@ -0,0 +1,6 @@
+from servo_tidy.tidy import LintRunner
+
+class Lint(LintRunner):
+ def run(self):
+ for _ in [None]:
+ yield ('path', 0, 'foobar')