Skip to content
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

Qute - remove standalone lines by default #10305

Merged
merged 1 commit into from
Jun 30, 2020
Merged

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Jun 26, 2020

@boring-cyborg boring-cyborg bot added area/documentation area/qute The template engine labels Jun 26, 2020
@mkouba mkouba added this to the 1.7.0 - master milestone Jun 26, 2020
@mkouba
Copy link
Contributor Author

mkouba commented Jun 26, 2020

CC @adrianfiedler @FroMage @ia3andy

@ia3andy
Copy link
Contributor

ia3andy commented Jun 26, 2020

2 fast 2 furious @mkouba 😂 🍻 that's awesome... I'll have a look on monday if you don't mind?

@mkouba
Copy link
Contributor Author

mkouba commented Jun 29, 2020

Ah, I forgot that String.isBlank() is @since 11...

@mkouba mkouba requested a review from ia3andy June 29, 2020 20:15
@ia3andy
Copy link
Contributor

ia3andy commented Jun 30, 2020

I have an error, I am rebuilding everything to make sure it's not due to my env..

@mkouba
Copy link
Contributor Author

mkouba commented Jun 30, 2020

@ia3andy no problem. Let me know if you hit a problem...

Copy link
Member

@FroMage FroMage left a comment

Choose a reason for hiding this comment

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

LGTM except docs which can be confusing to people like me.

public void testRemoveStandaloneLines() {
Engine engine = Engine.builder().addDefaults().removeStandaloneLines(true).build();
String content = "{@java.lang.String foo}\n" // -> standalone
+ "\n"
Copy link
Member

Choose a reason for hiding this comment

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

So, this appears to validate that the description:

A standalone line is a line that contains only section tags (e.g. {#each} and {/each}), parameter declarations (e.g. {@org.acme.Foo foo}) and whitespace characters.

has a confusing and. I initially thought this applied to empty lines as well, but this test says it does not.

Perhaps the following is less confusing for people like me?

A standalone line is a line that contains at least one of: section tags (e.g. {#each} and {/each}) or parameter declarations (e.g. {@org.acme.Foo foo}), ignoring any whitespace characters on the same line.

It's not perfect yet, though so if you find better, I'll take it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, as I read it it's confusing... let's fix it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it better now?

Copy link
Contributor

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

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

Very cool !!

The only thing to fix would be with the include inner blocks (which still generate new lines) as we discussed on zulip

@mkouba mkouba requested a review from FroMage June 30, 2020 10:39
Copy link
Member

@FroMage FroMage left a comment

Choose a reason for hiding this comment

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

Yup, clearer, thanks!

@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 30, 2020
@ia3andy
Copy link
Contributor

ia3andy commented Jun 30, 2020

@mkouba all good no more line with the include inner block 🍻

@ia3andy
Copy link
Contributor

ia3andy commented Jun 30, 2020

@mkouba ready to merge :)

@mkouba mkouba merged commit e2689cc into quarkusio:master Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation area/qute The template engine triage/waiting-for-ci Ready to merge when CI successfully finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qute: remove whitespace around type declarations
4 participants