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

More XML formatting #131

Merged
merged 5 commits into from
Jan 24, 2024
Merged

Conversation

khatchad
Copy link
Collaborator

I find this more readable.

  • Exclude Gradle files from XML formatting.
  • More XML formatting.
  • Apply spotless.

Copy link
Member

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

Quick question

Comment on lines +170 to +173
<exclude>**/pom.xml</exclude>
<exclude>**/dependency-reduced-pom.xml</exclude>
<exclude>**/gradle.xml</exclude>
<exclude>**/target/</exclude>
Copy link
Member

Choose a reason for hiding this comment

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

Why are we adding these excludes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. It's not to format those XML files. The ones in target don't get stored in Git.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pom.xml was already there. I just fixed the path pattern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The dependency reduced pom doesn't get stored in Git either. I guess we could format these if we want?

Copy link
Member

Choose a reason for hiding this comment

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

I don't have a particular opinion here 🙂 but why do we need to skip formatting? Does it lead to a bad format? Or does it make Spotless take too long to run?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With the files not stored in Git, right, it's to save time; the generated XML files can be quite large. With the others, let me try it and see how it looks. I cannot remember now why we originally skipped pom.xml, for example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like at least pom.xml was excluded here: d74b32b. The comment says:

Ignore pom.xml in XML formatting.
We have another formatter for that.

I am guessing that m2e is doing it's own formatting each time the file is edited using m2e. Other than that, I can't recall what other formatter we could be using ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NM, it's here:

ML/pom.xml

Line 186 in c40ccba

<pom>
.

It's actually already being done by spotless.

Copy link
Member

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

LGTM

@khatchad khatchad merged commit adf1894 into wala:master Jan 24, 2024
1 check passed
@khatchad khatchad deleted the contrib_xml_formatting branch January 24, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants