Skip to content

Commit 3af599f

Browse files
authored
fix: lint issues across plugins (#1151)
Signed-off-by: Frederico Araujo <[email protected]>
1 parent c7174fe commit 3af599f

File tree

43 files changed

+493
-845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+493
-845
lines changed

plugins/ai_artifacts_normalizer/ai_artifacts_normalizer.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
Hooks: prompt_pre_fetch, resource_post_fetch, tool_post_invoke
99
"""
1010

11+
# Future
1112
from __future__ import annotations
1213

14+
# Standard
1315
import re
14-
from typing import Any
1516

17+
# Third-Party
1618
from pydantic import BaseModel
1719

20+
# First-Party
1821
from mcpgateway.plugins.framework import (
1922
Plugin,
2023
PluginConfig,
@@ -27,16 +30,13 @@
2730
ToolPostInvokeResult,
2831
)
2932

30-
3133
SMART_MAP = {
3234
""": '"',
3335
""": '"',
3436
"„": '"',
35-
""": '"',
36-
"'": "'",
37+
'"': '"',
3738
"'": "'",
3839
"‚": "'",
39-
"'": "'",
4040
"—": "-",
4141
"–": "-",
4242
"−": "-",
@@ -54,9 +54,7 @@
5454
"ff": "ff",
5555
}
5656

57-
BIDI_AND_ZERO_WIDTH = re.compile(
58-
"[\u200B\u200C\u200D\u200E\u200F\u202A-\u202E\u2066-\u2069]"
59-
)
57+
BIDI_AND_ZERO_WIDTH = re.compile("[\u200b\u200c\u200d\u200e\u200f\u202a-\u202e\u2066-\u2069]")
6058

6159
SPACING_RE = re.compile(r"[ \t\x0b\x0c]+")
6260

plugins/argument_normalizer/argument_normalizer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"""
1717

1818
# Standard
19-
import re
20-
import unicodedata
2119
from dataclasses import dataclass
2220
from enum import Enum
21+
import re
2322
from typing import Any, Dict, List, Optional
23+
import unicodedata
2424

2525
# Third-Party
2626
from pydantic import BaseModel, Field
@@ -37,7 +37,6 @@
3737
)
3838
from mcpgateway.services.logging_service import LoggingService
3939

40-
4140
# Initialize logging service first
4241
logging_service = LoggingService()
4342
logger = logging_service.get_logger(__name__)

plugins/cached_tool_result/cached_tool_result.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
constraints; writes occur in tool_post_invoke.
1111
"""
1212

13+
# Future
1314
from __future__ import annotations
1415

1516
# Standard
17+
from dataclasses import dataclass
1618
import hashlib
1719
import json
1820
import time
19-
from dataclasses import dataclass
2021
from typing import Any, Dict, List, Optional
2122

2223
# Third-Party

plugins/citation_validator/citation_validator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
Hooks: resource_post_fetch, tool_post_invoke
1313
"""
1414

15+
# Future
1516
from __future__ import annotations
1617

18+
# Standard
1719
import re
1820
from typing import Any, Dict, List, Optional, Tuple
1921

22+
# Third-Party
2023
from pydantic import BaseModel
2124

25+
# First-Party
2226
from mcpgateway.plugins.framework import (
2327
Plugin,
2428
PluginConfig,
@@ -31,7 +35,6 @@
3135
)
3236
from mcpgateway.utils.retry_manager import ResilientHttpClient
3337

34-
3538
URL_RE = re.compile(r"https?://[\w\-\._~:/%#\[\]@!\$&'\(\)\*\+,;=]+", re.IGNORECASE)
3639

3740

plugins/code_formatter/code_formatter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
Hooks: tool_post_invoke, resource_post_fetch
1717
"""
1818

19+
# Future
1920
from __future__ import annotations
2021

22+
# Standard
2123
from textwrap import dedent
22-
from typing import Any, Dict, Optional
24+
from typing import Any, Optional
2325

26+
# Third-Party
2427
from pydantic import BaseModel
2528

29+
# First-Party
2630
from mcpgateway.plugins.framework import (
2731
Plugin,
2832
PluginConfig,
@@ -74,6 +78,7 @@ def _normalize_text(text: str, cfg: CodeFormatterConfig) -> str:
7478

7579

7680
def _try_format_json(text: str) -> Optional[str]:
81+
# Standard
7782
import json
7883

7984
try:

plugins/code_safety_linter/code_safety_linter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
either blocks or annotates based on mode.
1010
"""
1111

12+
# Future
1213
from __future__ import annotations
1314

1415
# Standard
1516
import re
16-
from typing import Any, List
17+
from typing import List
1718

1819
# Third-Party
1920
from pydantic import BaseModel, Field

0 commit comments

Comments
 (0)