Skip to content

Commit bc9b680

Browse files
author
Caio Fontes
committed
chore: fix linting
1 parent 0035fe5 commit bc9b680

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

elasticsearch_dsl/query.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,7 @@
1818
import collections.abc
1919
from copy import deepcopy
2020
from itertools import chain
21-
from typing import (
22-
Optional,
23-
Any,
24-
overload,
25-
TypeVar,
26-
Protocol,
27-
Callable,
28-
ClassVar,
29-
Union,
30-
)
21+
from typing import Any, Callable, ClassVar, Optional, Protocol, TypeVar, Union, overload
3122

3223
# 'SF' looks unused but the test suite assumes it's available
3324
# from this module so others are liable to do so as well.
@@ -66,7 +57,7 @@ def Q(
6657
QProxiedProtocol[_T],
6758
collections.abc.MutableMapping[str, _M],
6859
] = "match_all",
69-
**params: Any
60+
**params: Any,
7061
) -> Union["Query", _T]:
7162
# {"match": {"title": "python"}}
7263
if isinstance(name_or_query, collections.abc.MutableMapping):

elasticsearch_dsl/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import collections.abc
2020
from copy import copy
21-
from typing import Optional, Any, Self
21+
from typing import Any, Optional, Self
2222

2323
from .exceptions import UnknownDslObject, ValidationException
2424

@@ -252,7 +252,9 @@ class DslBase(metaclass=DslMeta):
252252
_param_defs = {}
253253

254254
@classmethod
255-
def get_dsl_class(cls: type[Self], name: str, default:Optional[str]=None) -> type[Self]:
255+
def get_dsl_class(
256+
cls: type[Self], name: str, default: Optional[str] = None
257+
) -> type[Self]:
256258
try:
257259
return cls._classes[name]
258260
except KeyError:
@@ -262,7 +264,7 @@ def get_dsl_class(cls: type[Self], name: str, default:Optional[str]=None) -> typ
262264
f"DSL class `{name}` does not exist in {cls._type_name}."
263265
)
264266

265-
def __init__(self, _expand__to_dot: Optional[bool]=None, **params: Any) -> None:
267+
def __init__(self, _expand__to_dot: Optional[bool] = None, **params: Any) -> None:
266268
if _expand__to_dot is None:
267269
_expand__to_dot = EXPAND__TO_DOT
268270
self._params = {}

noxfile.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
import nox
1918
import subprocess
2019

20+
import nox
2121

2222
SOURCE_FILES = (
2323
"setup.py",
@@ -29,9 +29,7 @@
2929
"utils/",
3030
)
3131

32-
TYPED_FILES = (
33-
"elasticsearch_dsl/query.py",
34-
)
32+
TYPED_FILES = ("elasticsearch_dsl/query.py",)
3533

3634

3735
@nox.session(
@@ -78,7 +76,7 @@ def lint(session):
7876
session.run("black", "--check", "--target-version=py38", *SOURCE_FILES)
7977
session.run("isort", "--check", *SOURCE_FILES)
8078
session.run("python", "utils/run-unasync.py", "--check")
81-
session.run("flake8", "--ignore=E501,E741,W503", *SOURCE_FILES)
79+
session.run("flake8", "--ignore=E501,E741,W503,E704", *SOURCE_FILES)
8280
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)
8381

8482

0 commit comments

Comments
 (0)