-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Make RST: Exclude godot-cpp test project files #103625
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
base: master
Are you sure you want to change the base?
Conversation
e6e97ee
to
bfd626c
Compare
@@ -731,6 +731,10 @@ def main() -> None: | |||
|
|||
if os.path.basename(path) in ["modules", "platform"]: | |||
for subdir, dirs, _ in os.walk(path): | |||
# Exclude godot-cpp test project files for the case of | |||
# third-party modules with godot-cpp inside of them. | |||
if "/godot-cpp/test" in subdir: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work even if the "godot-cpp" directory isn't at the top level?
I know most projects put it there, but I've got a couple that put it under "thirdparty" and other folks may do other things as well. Maybe we need a way to provide a list of exclude directories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in fact that's how I use it. This is just a string match, it will work regardless of how deep it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do paths returned by os.walk()
on Windows use forward slashes? If not, this check won't work on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fond of hardcoding something specific to a thirdparty repository here.
A project might use godot-cpp but with a different folder name (e.g. it may be cloned as godot-cpp.git
), and the test
folder may not always be there in the future or include documentation.
I think this would be better solved by improving the logic so it doesn't go so deep.
The patterns to support are:
modules/<name>/doc_classes
platform/<name>/doc_classes
So if we limit ourselves to one level of depth it should be fine I expect.
Otherwise, adding a way to pass excludes from the command line might be better than hardcoding exceptions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akien-mga In my module I am using modules/4d/addons/4d/doc_classes
. Thoufh it is possible to infer the maximum depth level if we read the modules config.py files, that would be a larger change than I originally intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
bfd626c
to
a700ad9
Compare
a700ad9
to
5551549
Compare
This is required to avoid erroring in the case of multiple third-party modules that can build as both GDExtension and engine modules while those modules also have godot-cpp cloned inside of them. Without this PR,
make_rst.py
will give an error about duplicate classes from the multiple godot-cpp test projects.I know this is a niche thing, but it would be nice to have the script working and CI passing in this case.