Merged
Conversation
Reviewer's Guide by SourceryThis pull request modifies the run_before_script function to address excessive newlines in the output. It now captures stdout and stderr, and only prints to the terminal if it's a TTY. Additionally, it raises an exception if the script returns a non-zero exit code. Sequence diagram for improved run_before_script execution flowsequenceDiagram
participant C as Caller
participant R as run_before_script
participant S as Shell Script
participant T as Terminal
C->>R: Execute script
R->>S: Start process (Popen)
activate S
loop While script running
S-->>R: Read stdout line
alt is TTY
R->>T: Write to stdout
end
S-->>R: Read stderr line
alt is TTY
R->>T: Write to stderr
end
end
S-->>R: Return exit code
deactivate S
alt exit code != 0
R->>R: Raise BeforeLoadScriptError
end
R-->>C: Return exit code
Flow diagram for run_before_script error handlingflowchart TD
A[Start] --> B{Script exists?}
B -->|No| C[Raise BeforeLoadScriptNotExists]
B -->|Yes| D[Start process]
D --> E{Read output}
E --> F{Is TTY?}
F -->|Yes| G[Write to terminal]
F -->|No| H[Buffer output]
G --> I{Process finished?}
H --> I
I -->|No| E
I -->|Yes| J{Exit code = 0?}
J -->|Yes| K[Return exit code]
J -->|No| L[Raise BeforeLoadScriptError]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #959 +/- ##
==========================================
+ Coverage 72.92% 73.11% +0.18%
==========================================
Files 26 26
Lines 1843 1856 +13
Branches 350 352 +2
==========================================
+ Hits 1344 1357 +13
- Misses 394 395 +1
+ Partials 105 104 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Hey @tony - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
10987af to
03e6e68
Compare
run_before_script() output capturing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tmuxp 1.52.0's before scripts print out a lot of newlines.
Summary by Sourcery
Bug Fixes: