- Fixed import sorting in cli.py, __main__.py, detectors/__init__.py, base.py, python.py, rust.py, openapi.py, models/__init__.py - Removed unused imports (sys, asyncio, Observer, Text, Parameter, ParameterIn, HTTPMethod, DocConfig, List, Optional) - Removed trailing whitespace from blank lines - Split lines exceeding 100 characters - Added missing __init__ docstrings in generators and static/templates packages
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
"""Base detector abstract class."""
|
||||
{"""Base detector abstract class."""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docgen.models import Endpoint
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import List
|
||||
pass
|
||||
|
||||
|
||||
class BaseDetector(ABC):
|
||||
@@ -28,12 +29,12 @@ class BaseDetector(ABC):
|
||||
"""Scan a directory for endpoints."""
|
||||
endpoints = []
|
||||
pattern = "**/*" if recursive else "*"
|
||||
|
||||
|
||||
for file_path in directory.glob(pattern):
|
||||
if file_path.is_file() and self.can_detect(file_path):
|
||||
try:
|
||||
endpoints.extend(self.detect_endpoints(file_path))
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
|
||||
return endpoints
|
||||
|
||||
Reference in New Issue
Block a user