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

the agent should give an error for malformed path entries #302

Closed
apotterri opened this issue May 6, 2024 · 1 comment · Fixed by #303
Closed

the agent should give an error for malformed path entries #302

apotterri opened this issue May 6, 2024 · 1 comment · Fixed by #303
Assignees
Labels
enhancement New feature or request

Comments

@apotterri
Copy link
Collaborator

The agent should check the format of a path entry in appmap.yml, and fail if it finds a bad one. In particular, it should detect entries that contain path separators (/, \) and offer a hint that path entries are module names, not directory paths.

@apotterri apotterri added the enhancement New feature or request label May 6, 2024
@apotterri
Copy link
Collaborator Author

The values of a path property needs to be a module name, so this would work:

def check_path_value(value):
    try:
        import ast
        ast.parse(f"import {value}")
        return True
    except SyntaxError:
        pass
    return False

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

Successfully merging a pull request may close this issue.

2 participants