-
Notifications
You must be signed in to change notification settings - Fork 492
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
feat(build cli): --no-rich-output
flag to prevent rich output
#3708
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new File-Level Changes
Tips
|
--no-rich-ouput
flag to prevent rich output --no-rich-output
flag to prevent rich output
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.
Hey @ndonkoHenri - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Incorrect dictionary key access (link)
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue, 5 other issues
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
self.dart_exe = None | ||
self.verbose = None | ||
self.flutter_dir = None | ||
self.flutter_exe = None |
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.
suggestion: Consider initializing instance variables in the constructor
It might be more appropriate to initialize self.dart_exe
, self.verbose
, self.flutter_dir
, and self.flutter_exe
in the constructor to ensure they are always set when an instance of the class is created.
self.dart_exe = None | |
self.verbose = None | |
self.flutter_dir = None | |
self.flutter_exe = None | |
def __init__(self, parser: argparse.ArgumentParser) -> None: | |
super().__init__(parser) | |
self.dart_exe: Optional[str] = None | |
self.verbose: Optional[bool] = None | |
self.flutter_dir: Optional[str] = None | |
self.flutter_exe: Optional[str] = None | |
self.platforms = { | |
"windows": { |
checkmark = ( | ||
"[green]✓[/]" | ||
if options.no_rich_output or get_bool_env_var("FLET_BUILD_NO_RICH_OUTPUT") | ||
else "✅" |
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.
issue (bug_risk): Inverted logic for checkmark
assignment
The logic for checkmark
assignment seems inverted. It should be if not options.no_rich_output and not get_bool_env_var("FLET_BUILD_NO_RICH_OUTPUT")
to use the rich output checkmark.
@@ -335,7 +355,7 @@ def handle(self, options: argparse.Namespace) -> None: | |||
with console.status( | |||
f"[bold blue]Initializing {target_platform} build... ", | |||
spinner="bouncingBall", | |||
) as status: | |||
) as self.status: |
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.
issue (bug_risk): Potential issue with self.status
reassignment
Reassigning self.status
within the with
block might lead to unexpected behavior if self.status
is used elsewhere in the class. Consider using a different variable name.
Possibly linked to please merge this PR? |
@FeodorFitsner do you think we should equally handle other emojis accordingly? |
Context
(this PR was completed by #3735)
The error in the below code block occured in a github action when trying to
build
a simple Windows application. It is raised because github action cli usescp1252
encoding, causing characters like ✅ not to be displayed.In this PR, we make it possible through the new optional
--no-rich-output
flag to prevent rich output (✅) from being displayed.Also, I created a method which runs
flutter doctor
in cases where the build fails.Summary by Sourcery
This pull request adds a new
--no-rich-output
flag to the build CLI, allowing users to disable rich output and use plain text instead. This is particularly useful for environments that do not support rich text encoding, such as certain GitHub Actions runners. Additionally, console log messages have been updated to respect this new flag.--no-rich-output
flag to the build CLI to disable rich output and use plain text instead.--no-rich-output
flag.