mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
mach: Enable ANN rules (type annotations) for ruff Python linter (#38531)
This changes will introduce [flake8-annotations (ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) for python type annotation, this will make all thing related to function strictly typed in python This rule will start to affected this directory from now: - /python -> Root directory - /python/tidy - /python/wpt Testing: `./mach test-tidy` Fixes: Not related to any issues --------- Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This commit is contained in:
parent
9c1ee4be83
commit
797db25c4e
13 changed files with 122 additions and 70 deletions
|
@ -9,7 +9,7 @@
|
|||
|
||||
import logging
|
||||
import os
|
||||
from typing import Iterable, Tuple
|
||||
from collections.abc import Iterable
|
||||
import unittest
|
||||
|
||||
from . import tidy
|
||||
|
@ -180,7 +180,7 @@ class CheckTidiness(unittest.TestCase):
|
|||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_raw_url_in_rustdoc(self):
|
||||
def assert_has_a_single_rustdoc_error(errors: Iterable[Tuple[int, str]]):
|
||||
def assert_has_a_single_rustdoc_error(errors: Iterable[tuple[int, str]]):
|
||||
self.assertEqual(tidy.ERROR_RAW_URL_IN_RUSTDOC, next(errors)[1])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue