Conversation
Add --strict-syntax-mode CLI flag requiring Python 3.12+ syntax and explicit annotations. - Refuse old Generic[T] syntax, require PEP 695 syntax. - Require explicit annotations for variables, function arguments, and return types where Any is inferred. - Improve type inference to support strict mode checks. - Propagate TranspilerConfig through the translator. - Add comprehensive tests for strict mode enforcement. Co-authored-by: yaskhan <3676373+yaskhan@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Pull request #221 has conflicts that needs to be resolved. |
|
Pull request #221 has conflicts that needs to be resolved. |
This change implements the requested Strict Syntax Mode. It introduces a new CLI flag
--strict-syntax-modethat enforces modern Python 3.12+ typing standards and requires explicit annotations to eliminate implicitAnytypes in the transpiled V code.Key changes:
TranspilerConfignow includesstrict_syntax_mode.main.pysupports the new flag and re-raisesSyntaxErrorfor better error reporting.TranslatorBaseand its subclasses have access to the configuration.ClassesMixinrejectsGeneric[T]inheritance in strict mode.AssignmentsMixinandFunctionsMixinrequire explicit annotations for targets inferred asAny.TypeInferencenow collects function return types.ModuleMixinensures top-level assignments are correctly processed and checked.py2v_transpiler/tests/test_strict_syntax.pyverifies all strict mode requirements.Fixes #204
PR created automatically by Jules for task 4321059608732374860 started by @yaskhan