Safe-DS / Stub-Generator

Automated generation of Safe-DS stubs for Python libraries.
https://stubgen.safeds.com
MIT License
3 stars 0 forks source link

fix: Fixing various bugs which appear with different libraries #168

Open Masara opened 3 months ago

Masara commented 3 months ago

Summary of Changes

github-actions[bot] commented 3 months ago

πŸ¦™ MegaLinter status: βœ… SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
βœ… PYTHON black 14 0 0 1.59s
βœ… PYTHON mypy 14 0 6.45s
βœ… PYTHON ruff 14 0 0 0.04s
βœ… REPOSITORY git_diff yes no 0.03s

See detailed report in MegaLinter reports _Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff_

_MegaLinter is graciously provided by OX Security_

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.84%. Comparing base (0a8ef17) to head (fbe2a20).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #168 +/- ## ========================================== + Coverage 99.57% 99.84% +0.26% ========================================== Files 26 26 Lines 2603 2618 +15 ========================================== + Hits 2592 2614 +22 + Misses 11 4 -7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Masara commented 3 months ago

@lars-reimann Could you remind me how the stubs have to handle None as a return type? So for example these cases:

def fun1() -> None: ...

def fun2():
    return

def fun3():
    return None

Should the SDS-Stubs look like this for all three cases:

fun fun*()

? or should they all have a trailing -> result1: Nothing??

Masara commented 3 months ago

Answer to the question:

def fun1() -> None: ...

fun fun1()

def fun2():
    return

fun fun2()

def fun3():
    return None

fun fun3() -> result1: Nothing?
Masara commented 3 months ago

I decided to not change anything concerning the handling of "None" from the cases stated above, because it seems we already implemented everything concerning that topic already in the past. So the current state would be that every case creates the stubs without the -> result1: Nothing? part.

Masara commented 3 months ago

@lars-reimann This is ready for a review. I checked the stub changes on the other branch and everything seemed all right to me.