From 013cebb73013194566bb62d9701cbe683e434ba3 Mon Sep 17 00:00:00 2001 From: iwatkot Date: Thu, 20 Jun 2024 03:15:46 +0200 Subject: [PATCH] Pylint action. --- .github/workflows/check_with_pylint.yml | 2 +- py3xui/inbound/bases.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_with_pylint.yml b/.github/workflows/check_with_pylint.yml index 119f2f6..0438d7f 100644 --- a/.github/workflows/check_with_pylint.yml +++ b/.github/workflows/check_with_pylint.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pylint + pip install pylint pydantic requests - name: Run pylint run: pylint py3xui \ No newline at end of file diff --git a/py3xui/inbound/bases.py b/py3xui/inbound/bases.py index e15094d..087d8c9 100644 --- a/py3xui/inbound/bases.py +++ b/py3xui/inbound/bases.py @@ -5,6 +5,7 @@ from pydantic import BaseModel, model_validator +# pylint: disable=too-few-public-methods class JsonStringModel(BaseModel): """Base class for models that have a JSON string as a field.""" @@ -13,6 +14,14 @@ def model_validate( cls, values, ): # pylint: disable=no-self-argument, arguments-differ + """Converts the JSON string to a dictionary if it is a string. + + Args: + values (Any): The values to validate. + + Returns: + Any: The validated values. + """ if isinstance(values, str): try: return json.loads(values)