Add typing to Worker module
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Currently, all cortexutils is missing typing, but we should start with the worker module as it is the root of the inheritance.
This makes writing analyzers with any static type checker very tedious.
One example of a noisy/hard function to type is any that uses error with conditional branching:
from cortexutils.analyzer import Analyzer
class ExampleAnalyzer(Analyzer):
...
def preprocess_url(self, url: str) -> str:
if not url.startswith("http"):
self.error(f"Invalid URL: {url}")
else:
processed_url = url.lower()
return processed_url
cortexutils/example.py:5: error: Missing return statement [return]
Found 1 error in 1 file (checked 6 source files)
Current workaround is to add # type: ignore[return], which is not ideal as it invalidates most of the type safety.
- Lenguaje dominante
- Python
- Estrellas
- 8
- Forks
- 18
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TheHive-Project/cortexutils
-
Enroll cortexutils to codecovQuizá libre de nuevo @Kamforka la tomó hace 120 días y no hay ningún pull request abierto. Abiertoenhancement
TheHive-Project/cortexutils#36 · 1 asignado ·
-
Add or rework integration testsPosiblemente ocupada @Kamforka la tomó hace 125 días. Abiertoenhancement
TheHive-Project/cortexutils#34 · 1 asignado ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
TheHive-Project/cortexutils#12 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Todos los issues de TheHive-Project/cortexutils
Issues similares
-
Broken links in the docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
uniswap-python/uniswap-python#487 ·
-
[Bug]: agent_final_response still returns the abandoned branch's answer after navigate moves HEAD backPosiblemente ocupada @enyst la tomó hoy. Abiertobug priority:low ready-for-dev
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenHands/software-agent-sdk#5822 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
area: server enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
scs0209/laya-guard#52 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días