-
Couldn't load subscription status.
- Fork 22
Fix/formatter reporting and early exit #853
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
⚡️ Codeflash found optimizations for this PR📄 1,676% (16.76x) speedup for
|
| tmp_file.write_text(tmp_code, encoding="utf-8") | ||
| format_code(formatter_cmds, tmp_file, print_status=False, exit_on_failure=False) | ||
| return True | ||
| except FileNotFoundError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there might be exceptions other than FileNotFoundError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, and they're caught right below, this just makes the output better looking for when we know it's not FileNotFoundError
User description
check for the formatter as early as we can so that we don't run into these problems later on
PR Type
Bug fix, Enhancement
Description
Robust formatter presence check with early exit
Improved formatter error messages and panels
Centralize check at CLI entry, remove duplicate
Safer command parsing and which lookup
Diagram Walkthrough
File Walkthrough
env_utils.py
Harden formatter check with preflight executioncodeflash/code_utils/env_utils.py
formatter.py
Clearer formatter not-found panel outputcodeflash/code_utils/formatter.py
main.py
Centralize early formatter check in CLI maincodeflash/main.py
optimizer.py
Deduplicate formatter check in optimizercodeflash/optimization/optimizer.py