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

Overhaul OS documentation #80282

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Aug 5, 2023

Draft because more could be done soon. I would love your assistance!

Continuation of similar past efforts with the same goal of refreshing the documentation up a notch.

This is particularly prickly due of the sheer size. There's also a constant fear of possibly losing important information, or making use of incorrect technical terms. A lot of the time is spent reading the original documentation and looking at the source code, too. Fortunately, a decent majority of it is written... quite up to date, too.

  • Made the wording match how other classes are documented A LOT more closely;
    • Simplified wording which may be seen as awkward to read, kinda like this very sentence;
    • Use the present simple over future tense when applicable (will return -> returns);
    • Turned some long-winded sentences into notes at the end (and viceversa);
    • Turned some multiple paragraphs into lists;
  • Link to other methods and parameters more often;
  • Add more examples all around;
  • Describe ERR_* constants return values;
  • Note more methods moved out of the OS class in the transition to Godot 4;
  • All SystemDir constants' descriptions have been prefixed with "Refers to":
    • They could be mistaken to be constant strings, otherwise.

close_midi_inputs, get_connected_midi_inputs, open_midi_inputs

  • Link the methods between one another.

get_cmdline_user_args

  • Rework description entirely.
    • The previous one was a bit unorganized.

get_keycode_string, find_keycode_from_string

  • Add considerably more examples.

request_permission, revoke_granted_permissions

  • Rework description entirely.
    • The previous one was absolutely not formatted the same as the rest of the documentation.

get_user_data_dir

  • Mention ProjectSettings.application/config/use_custom_user_dir directly.

Feedback is very, very welcome, even in the draft state. And especially right now. This class is huge and very technical.

In fact, I would like to propose a few questions that may help with this cause:

  • "Web platform" or "Web platforms"? Capitalized "Web" or not?
  • Is OS.move_to_trash() really implemented only on Android, Linux, macOS and Windows?
  • Do OS.request_permission and OS.request_permission return true when permissions are granted successfully?
  • What does OS.set_use_file_access_save_and_swap really do?

doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Show resolved Hide resolved
@bruvzg
Copy link
Member

bruvzg commented Aug 5, 2023

What does OS.set_use_file_access_save_and_swap really do?

If enabled when opening a file for writing, a temporary file is used first, and only when it's closed it is renamed or used to replace an existing file. This is useful in case the original file is opened by other app, scanned by antivirus for example.

@Mickeon
Copy link
Contributor Author

Mickeon commented Aug 5, 2023

Pushed a commit that also attempts to address the above comments. I hope you check again.

@Mickeon Mickeon requested a review from bruvzg August 5, 2023 20:23
@Mickeon Mickeon force-pushed the doc-peeves-ostrich branch 2 times, most recently from a4f4766 to 8435e70 Compare August 6, 2023 15:04
@Mickeon
Copy link
Contributor Author

Mickeon commented Aug 6, 2023

How did the latest unit test even fail?

@dalexeev dalexeev added this to the 4.x milestone Aug 7, 2023
@YuriSizov
Copy link
Contributor

How did the latest unit test even fail?

Unit tests didn't fail, but there is a problem with thread sanitizer runs. It's not related to your PR and seems to happen sporadically, a re-run fixed it.

@Mickeon
Copy link
Contributor Author

Mickeon commented Sep 17, 2023

Rebased after #81416

doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
@Mickeon
Copy link
Contributor Author

Mickeon commented Sep 17, 2023

Pushed changes that accept the C# suggestions above. Thank you @raulsntos for the additional attention to this PR.

doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
@Mickeon
Copy link
Contributor Author

Mickeon commented Dec 30, 2023

Rebased after:

Would be nice for this to be taken a look at sooner than later

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

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

Some minor changes, style looks good otherwise, can't speak for the factual correctness however so someone else needs to verify

doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
@Mickeon
Copy link
Contributor Author

Mickeon commented Dec 30, 2023

Addressed the above feedback. Thank you.

I also moved the mention of kill in the crash method description outside of the note, because it is directly related.

doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
doc/classes/OS.xml Outdated Show resolved Hide resolved
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Only skimmed through the changes, looks good overall.

@Mickeon Mickeon force-pushed the doc-peeves-ostrich branch 3 times, most recently from 67adb05 to c7931d5 Compare January 4, 2024 11:13
doc/classes/OS.xml Outdated Show resolved Hide resolved
@Mickeon
Copy link
Contributor Author

Mickeon commented Jan 4, 2024

Reverted that comma, but also updated the midi methods' descriptions taking them from #86693. So, whichever gets merged first, they're the same.

@akien-mga akien-mga merged commit ea3e3b0 into godotengine:master Jan 4, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

9 participants