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

Fix dumping "filepath" to a dict when it is a list #207

Merged
merged 2 commits into from
Sep 9, 2023
Merged

Fix dumping "filepath" to a dict when it is a list #207

merged 2 commits into from
Sep 9, 2023

Conversation

davfsa
Copy link
Contributor

@davfsa davfsa commented Sep 9, 2023

While having a look at the source code, I realized that filepath was being incorrectly dumped as a string when being a list of paths, rather than as a list of strings.

"filepath": "[PosixPath('mod'), PosixPath('/home/davfsa/coding/test_mod')]"

vs

"filepath": [
    "mod",
    "/home/davfsa/coding/test_mod"
]

I have not added any tests, due to the lack of them in the module (at the time of writing). If it were needed, I could write it up :)

Copy link
Member

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

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

Thanks, good catch! Just a suggestion 🙂

src/griffe/dataclasses.py Outdated Show resolved Hide resolved
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Copy link
Member

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

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

Thanks again!

@pawamoy pawamoy merged commit 066a4a7 into mkdocstrings:main Sep 9, 2023
16 checks passed
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

Successfully merging this pull request may close these issues.

2 participants