normalize code before hashing#307
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
| code = str(filtered_node.code) | ||
| if code_context_type == CodeContextType.HASHING: | ||
| code = ast.unparse(ast.parse(code)) # Makes it standard | ||
| return code |
There was a problem hiding this comment.
codeflash/code_utils/code_replacer.py has normalize_code
There was a problem hiding this comment.
yes but it did more things as well which i did not want to happen. I have already removed those sections earlier in the libcst processing code
PR Type
Enhancement, Tests
Description
Normalize code before hashing using ast.unparse
Standardize environment checks and quoting
Update tests to use single quotes
Remove extraneous comments and blank lines
Changes walkthrough 📝
code_context_extractor.py
Normalize code before hashingcodeflash/context/code_context_extractor.py
test_code_context_extractor.py
Standardize test quoting and formattingtests/test_code_context_extractor.py