Skip to content

feat: add syntax warning param and refactor error message (issue #28)#47

Merged
ParzivalHack merged 2 commits intoParzivalHack:mainfrom
Inzerd:syntax-warning-issue-28
Apr 14, 2026
Merged

feat: add syntax warning param and refactor error message (issue #28)#47
ParzivalHack merged 2 commits intoParzivalHack:mainfrom
Inzerd:syntax-warning-issue-28

Conversation

@Inzerd
Copy link
Copy Markdown
Collaborator

@Inzerd Inzerd commented Apr 14, 2026

GOAL:

fix issue #28, refactor message error during AST file parsing and add a new param to enable python SyntaxWarning

Changes

  • CLI & Wizard Mode: Added a new parameter (flag) to enable/disable SyntaxWarning reporting. This allows users to decide if they want to treat syntax warnings as blocking issues or ignore them during scans.
  • Refactoring get_python_file_asts:
    • Improved the logic that captures and reports errors during AST generation.
    • Standardized error messages to make them more descriptive when a file fails to parse.
    • Integrated the new enable_syntax_warnings logic within the core file-walking loop.
  • Created a new test suite test_get_asts.py to verify:
    • Default behavior (warnings ignored).
    • Behavior when warnings are enabled (treated as errors/exceptions).
    • Handling of valid, invalid, and encoding-error files.

Copy link
Copy Markdown
Owner

@ParzivalHack ParzivalHack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed by mistake the import from __future__ import annotations at the top of the file, which i added back. The rest is great, and i require no further changes :)

@ParzivalHack ParzivalHack merged commit 3c115f2 into ParzivalHack:main Apr 14, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants