Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an extension for parsers #894

Open
ericwb opened this issue May 4, 2022 · 0 comments
Open

Create an extension for parsers #894

ericwb opened this issue May 4, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ericwb
Copy link
Member

ericwb commented May 4, 2022

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Bandit currently utilizes the Python base ast module for parsing. But there are other
parsers out there that might be beneficial to use instead. For example, libcst is concrete
syntax tree, which may provide additional capabilities to analyze the code more deeply or
provide better remediation. Another parser is tree-sitter which could be more performant and potentially add the capability to parse other languages.

The feature being proposed here is to provide a extension mechanism similar to what we
already provide for formatters and check plugins. Then abstract the hard-coded calls to the
ast module to use the extension manager.

Describe alternatives you've considered
If someone desires to utilize a different parsing mechanism, the only other option
would be to rewrite much of the guts of Bandit with the new parser.

Additional context
https://libcst.readthedocs.io/en/latest/index.html
https://tree-sitter.github.io/tree-sitter/

Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.

@ericwb ericwb added the enhancement New feature or request label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant