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

Indentation in the cards XML: 2 vs. 4 spaces #288

Open
tooomm opened this issue Dec 1, 2024 · 2 comments
Open

Indentation in the cards XML: 2 vs. 4 spaces #288

tooomm opened this issue Dec 1, 2024 · 2 comments

Comments

@tooomm
Copy link
Contributor

tooomm commented Dec 1, 2024

I realized that we use 4 spaces for the "Token" file:
https://raw.githubusercontent.com/Cockatrice/Magic-Token/refs/heads/master/tokens.xml

But only 2 spaces in the "Spoiler" file:
https://raw.githubusercontent.com/Cockatrice/Magic-Spoiler/refs/heads/files/spoiler.xml

Would like to see that harmonized across XML files in the project.

(cards.xml generated by Oracle uses 4 spaces, not sure if using only 2 would reduce the file size even, considering the huge amount of cards in there)

@ebbit1q
Copy link
Member

ebbit1q commented Dec 1, 2024

the token file is edited by hand, a more human readable 4 spaces is appropriate, the spoiler file is created automatically and is currently downloaded by the client uncompressed, a bandwidth saving but still human readable 2 spaces is appropriate.

we don't really have a guideline on how our xmls are formatted, it's mostly a machine read format that has whitespace as optional.

oracle's 4 space file is machine generated, using 2 spaces would noticeably reduce its size (from 44MB to 38MB according to my estimate) but such a change is not very significant considering the app quickly occupies this amount of space after downloading one deck of card images. If this use of disk space were an issue, we'd gain more efficiency compressing the xml than reducing the indentation.

@Psithief
Copy link
Contributor

Psithief commented Dec 3, 2024

There's no obvious storage space issue and since it is XML there's an implication that it should be legible. So do you think 4 spaces or 2 spaces is more legible, and if your answer is 2, do you think enough people would agree to change the Oracle output?

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

No branches or pull requests

3 participants