Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Explanation from colin:

If you kept the text as it, it could break too early and leave a lot of whitespace:

```
The Ruby buildpack detected a package.json file but it is not readable           | <- term width
due to the following errors:                                                     |
```

This is sometimes okay.  or the worse case is a small terminal where it breaks too late and causes weird wrapping:

```
The Ruby buildpack detected a package.json file but | <- term width 
it is not readable                                  |
due to the following errors:                        |
```
---
Richard: I agree this is a sub-optimal experience. We should use double newline to indicate paragraphs and let the terminal handle wrapping for us within the paragraph.

I'm unsure of how this will interact with colorized output as it might color the `remoteL` annotations. Either that or the indentation won't align. I'm not sure how different terminals handle that case. 

Trying it out it looks like this:

```
$ cat bin/detect
#!/usr/bin/env bash

echo "Worked"
⛄️ 3.1.4 🚀 /tmp/8efcb3e683a408206c4c8f017697f813 (main)
$ cat bin/compile
#!/usr/bin/env bash

echo -e "\e[0;31mhihihihihihihihihihi hihihihihihihihihihihihihihihi hihihihihihihi hi hihihihihihihihihi hihihihihihihihihihi hihihihihihi hihihihihihihihihihi hihihihihihihihihi hihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihi hihihi\e[0m"
⛄️ 3.1.4 🚀 /tmp/8efcb3e683a408206c4c8f017697f813 (main)
$ heroku buildpacks
=== immense-beyond-95949 Buildpack URL

heroku-community/inline
```

```
$ git push
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (7/7), 482 bytes | 482.00 KiB/s, done.
Total 7 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Updated 3 paths from e061d88
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: heroku-community/inline
remote: -----> Worked app detected
remote: hihihihihihihihihihi hihihihihihihihihihihihihihihi hihihihihihihi hi hihihihihihihihihi hihihihihihihihihihi hihihihihihi hihihihihihihihihihi hihihihihihihihihi hihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihi hihihi
remote: -----> Discovering process types
remote:        Procfile declares types -> (none)
remote:
remote: -----> Compressing...
remote:        Done: 320B
remote: -----> Launching...
remote:        Released v3
remote:        https://immense-beyond-95949-a2b498662b8a.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/immense-beyond-95949.git
 * [new branch]      main -> main
```

It looks like this: https://imgur.com/a/sOscF4m

Co-authored-by: Colin Casey <[email protected]>
  • Loading branch information
schneems and colincasey authored Jan 8, 2024
1 parent 21577a2 commit 019dd94
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions buildpacks/ruby/src/user_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ fn log_our_error(mut log: Box<dyn StartedLogger>, error: RubyBuildpackError) {
log.announce().error(&formatdoc! {"
Error: `Gemfile` found with error
There was an error trying to read the contents of the application's Gemfile.
The buildpack cannot continue if the Gemfile is unreadable.
There was an error trying to read the contents of the application's Gemfile. \
The buildpack cannot continue if the Gemfile is unreadable.
{error}
Expand All @@ -61,23 +61,23 @@ fn log_our_error(mut log: Box<dyn StartedLogger>, error: RubyBuildpackError) {
log.announce().error(&formatdoc! {"
Error: `package.json` found with error
The Ruby buildpack detected a package.json file but it is not readable
The Ruby buildpack detected a package.json file but it is not readable \
due to the following errors:
{error}
If your application does not need any node dependencies installed,
If your application does not need any node dependencies installed, \
you may delete this file and try again.
If you are expecting node dependencies to be installed, please
If you are expecting node dependencies to be installed, please \
debug using the above information and try again.
"});
}
RubyBuildpackError::BuildpackDetectionError(DetectError::GemfileLock(error)) => {
log.announce().error(&formatdoc! {"
Error: `Gemfile.lock` found with error
There was an error trying to read the contents of the application's Gemfile.lock.
There was an error trying to read the contents of the application's Gemfile.lock. \
The buildpack cannot continue if the Gemfile is unreadable.
{error}
Expand All @@ -89,15 +89,15 @@ fn log_our_error(mut log: Box<dyn StartedLogger>, error: RubyBuildpackError) {
log.announce().error(&formatdoc! {"
Error: `yarn.lock` found with error
The Ruby buildpack detected a yarn.lock file but it is not readable
The Ruby buildpack detected a yarn.lock file but it is not readable \
due to the following errors:
{error}
If your application does not need yarn installed, you
If your application does not need yarn installed, you \
may delete this file and try again.
If you are expecting yarn to be installed, please
If you are expecting yarn to be installed, please \
debug using the above information and try again.
"});
}
Expand Down

0 comments on commit 019dd94

Please sign in to comment.