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

Add additional type hints #3278

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Conversation

bjoernricks
Copy link
Contributor

Pull Request Checklist

  • Ensured tests pass and (if applicable) updated functional test output
  • Conformed to code style guidelines by running appropriate linting tools

Adding the types spotted issues with the Contents.source_path attribute if it's None. For example relative_dir property will crash in that case.

@avaris
Copy link
Member

avaris commented Jan 18, 2024

Can I request that you combine these into a single PR? Commit for each file is fine but PR per file is a bit much :).

@bjoernricks
Copy link
Contributor Author

Can I request that you combine these into a single PR? Commit for each file is fine but PR per file is a bit much :).

Of course. Just let me know how it work best for you. Most projects prefer smaller PRs because they are easier and faster to merge.

@bjoernricks bjoernricks mentioned this pull request Jan 19, 2024
2 tasks
@bjoernricks bjoernricks changed the title Add type hints for contents module Add additional type hints Jan 22, 2024
pelican/contents.py Outdated Show resolved Hide resolved
pelican/contents.py Outdated Show resolved Hide resolved
pelican/contents.py Outdated Show resolved Hide resolved
pelican/utils.py Outdated Show resolved Hide resolved
pelican/utils.py Outdated Show resolved Hide resolved
Types make it easier to understand the code and improve autocompletion
in IDEs.
Types make it easier to understand the code and improve autocompletion
in IDEs.
Copy link
Member

@avaris avaris left a comment

Choose a reason for hiding this comment

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

Perfect, thank you. For the patience as well :).

Copy link
Member

@justinmayer justinmayer left a comment

Choose a reason for hiding this comment

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

Many thanks to @bjoernricks for the enhancement and to @avaris for reviewing.

@justinmayer justinmayer merged commit dbf90a4 into getpelican:master Jan 24, 2024
15 checks passed
@bjoernricks bjoernricks deleted the contents-types branch January 25, 2024 06:02
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.

3 participants