Skip to content

Commit

Permalink
CI: update pylint to support python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed May 13, 2024
1 parent 201e5ae commit 25022c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion core/services/ardupilot_manager/mavlink_proxy/Endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def is_mavlink_endpoint(cls: Type["Endpoint"], values: Any) -> Any:
EndpointType.TCPServer,
EndpointType.TCPClient,
]:
# pylint: disable-next=too-many-function-args
if not (validators.domain(place) or validators.ipv4(place) or validators.ipv6(place)):
raise ValueError(f"Invalid network address: {place}")
if argument not in range(1, 65536):
Expand Down
6 changes: 3 additions & 3 deletions core/services/ardupilot_manager/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from enum import Enum, auto
from pathlib import Path
from platform import machine
from typing import Any, Dict, List, Optional
from typing import Dict, List, Optional

from pydantic import BaseModel, validator

Expand Down Expand Up @@ -189,13 +189,13 @@ class Serial(BaseModel):
endpoint: str

@validator("port")
def valid_letter(cls: Any, value: str) -> str:
def valid_letter(self, value: str) -> str:
if value in "BCDEFGH" and len(value) == 1:
return value
raise ValueError(f"Invalid serial port: {value}. These must be between B and H. A is reserved.")

@validator("endpoint")
def valid_endpoint(cls: Any, value: str) -> str:
def valid_endpoint(self, value: str) -> str:
if Path(value).exists():
return value
if re.compile(r"tcp:\d*:wait$").match(value):
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ toml = "^0.10.2"
[tool.poetry.dev-dependencies]
black = "==22.3.0"
isort = "^5.8"
pylint = "^2.8"
pylint = "^3.1"
mypy = "1.4.1"
pylint-pydantic = "^0.2.4"
pylint-pydantic = "^0.3.2"
pytest = "7.4.2"
pytest-cov = "4.1.0"
pydantic = "1.10.12"
Expand Down Expand Up @@ -96,6 +96,8 @@ ignore = [
load-plugins = "pylint_pydantic"
enable = "all"
disable = [
"use-implicit-booleaness-not-comparison-to-zero",
"use-implicit-booleaness-not-comparison-to-string",
"attribute-defined-outside-init",
"broad-except",
"duplicate-code",
Expand Down

0 comments on commit 25022c4

Please sign in to comment.