Skip to content

Conversation

hazendaz
Copy link
Contributor

While reviewing repo, detected 2 files with tab characters instead of spaces and 20 other files that did not adhere to git expectations of empty line at end of file. This is a no-opt change that ensures the entire repo follows same standard as all other files complied.

@slawekjaranowski
Copy link
Member

@hazendaz please look at build result

@elharo
Copy link
Contributor

elharo commented Aug 27, 2025

Test failures look related:

 Error:  Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.5:check (default) on project maven-wrapper-distribution: Unable to check file /home/runner/work/maven-wrapper/maven-wrapper/maven-wrapper-distribution/src/resources/only-mvnw: Unexpected response status code at /prettier/format [HTTP 500] -- (Error while formatting: SyntaxError: unclosed here-document 'END'
Error:    202 |   javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
Error:    203 |   targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
Error:  > 204 |   cat >"$javaSource" <<-END
Error:        |                      ^
Error:    205 |     public class Downloader extends java.net.Authenticator
Error:    206 |     {
Error:    207 |       protected java.net.PasswordAuthentication getPasswordAuthentication())
Error:  -> [Help 1]

@gzm55
Copy link
Contributor

gzm55 commented Aug 27, 2025

w

Test failures look related:

 Error:  Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.5:check (default) on project maven-wrapper-distribution: Unable to check file /home/runner/work/maven-wrapper/maven-wrapper/maven-wrapper-distribution/src/resources/only-mvnw: Unexpected response status code at /prettier/format [HTTP 500] -- (Error while formatting: SyntaxError: unclosed here-document 'END'
Error:    202 |   javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
Error:    203 |   targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
Error:  > 204 |   cat >"$javaSource" <<-END
Error:        |                      ^
Error:    205 |     public class Downloader extends java.net.Authenticator
Error:    206 |     {
Error:    207 |       protected java.net.PasswordAuthentication getPasswordAuthentication())
Error:  -> [Help 1]

when shell parses the here-doc <<-END, he iterators every following lines, since the end tag -END begins with a dash -, it remove all ident tab \t chars from the read line, then if the line is END exactly, the here-doc loop ends. When change ident tabs to spaces, the shell found " END" != "END", so the loop will not stop at END as expected.

@slawekjaranowski
Copy link
Member

so we need to use a tab character with <<- or remove all whitespace from here-doc and use <<

@hazendaz
Copy link
Contributor Author

I believe its fixed now, I removed the leading space from END.

@@ -202,19 +202,19 @@ elif set_java_home; then
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use <<END as we don't have a tabs now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants