Skip to content

docs: convert docstrings to Google style in parser_tools and component (#1072) - #1749

Open
AhmadBilalDSA wants to merge 29 commits into
PyCalendar:mainfrom
AhmadBilalDSA:fix/typing-prop-components
Open

AhmadBilalDSA wants to merge 29 commits into
PyCalendar:mainfrom
AhmadBilalDSA:fix/typing-prop-components

Conversation

@AhmadBilalDSA

@AhmadBilalDSA AhmadBilalDSA commented Sep 1, 2026 •

Copy link
Copy Markdown

Linked issue

Description

Converts the docstrings in src/icalendar/parser_tools.py and src/icalendar/cal/component.py to Google style with Parameters and Returns sections, following the project style guide. Parameters are listed required-first and alphabetically within each group, defaults are documented, and walk now renders correctly with explicit type hints.

Checklist

  • I added a change log entry, following the instructions in all subsections under Change log requirements.
  • I followed icalendar's Artificial intelligence policy and disclosed my Responsible AI use in my commit messages, if applicable.
  • I added or updated tests, if applicable.
  • I ran and ensured all tests pass locally by following Run tests.
  • I added or edited documentation as necessary, both as docstrings to be rendered in the API documentation and narrative documentation, following the Style guide.

Additional information

Local checks: 22,367 tests passed (9 pre-existing Windows newline failures), ruff check and ruff format --check clean, and the Component.walk signature and select description render in the built API docs.

@github-actions github-actions Bot added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Profile summary:

GitHub user: AhmadBilalDSA
🔴 Significant concerns found with user's profile.
🟡 Some concerns found with recent PR activity.
🟢 No concerns found with recent issue activity.

For a more detailed report, run `gh-profiler AhmadBilalDSA`.
Full profile
GitHub user: AhmadBilalDSA
🔴 Significant concerns found with user's profile.
   🔴 Account age: a month
   🟢 Profile information:
        name: Ahmad Bilal
        location: Pakistan
        email: kierninja@gmail.com
        bio: Data Analyst & Analytics Specialist bridging business intelligence and data engineering. Focused on Python, SQL, DuckDB/Polars, and building automated data work
        linkedin: https://linkedin.com/in/AhmadBilalDES
      Empty fields: company, blog

🟡 Some concerns found with recent PR activity.
   40 PRs opened in the last 21 days.
      9 opened against repos the user owns.
      0 opened against repos in publicly associated orgs.
      31 opened against external repos.

   🟡 7 of 31 external PRs closed without merging in the last 21 days.

🟢 No concerns found with recent issue activity.
   5 new issues opened in the last 21 days.
      3 opened in repos the user owns.
      0 opened in repos in publicly associated orgs.
      2 opened in external repos.

   🟢 0 external issues closed as NOT_PLANNED.
   🟢 0 external issues opened with the same title.

@read-the-docs-community

read-the-docs-community Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

AhmadBilalDSA added a commit to AhmadBilalDSA/icalendar that referenced this pull request Sep 1, 2026
@AhmadBilalDSA

Copy link
Copy Markdown
Author

Hi @stevepiercy @niccokunzmann,

I have added the changelog entry to resolve the changelog check.

Regarding the bot tag: this PR is strictly scoped to converting docstrings in parser_tools.py and cal/component.py to Google Python Style for #1072, with all tests passing locally via pytest.

Please let me know if you would like any adjustments to the wording or style.

AhmadBilalDSA added a commit to AhmadBilalDSA/icalendar that referenced this pull request Sep 1, 2026
AhmadBilalDSA added a commit to AhmadBilalDSA/icalendar that referenced this pull request Sep 1, 2026

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please revert all section headings of Args back to Parameters. See Docstring structure and the note under Parameters for an explanation. Thank you!

@angatha angatha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a small note: You wrote "Fixes #xxx". That would close the Issue once th PR is merged. Since the issue is (most likely) not done with this, use "See #xxx" instead. That will link the issue but does not close it.

@coveralls-official

coveralls-official Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 97.652% (+0.001%) from 97.651% — AhmadBilalDSA:fix/typing-prop-components into collective:main

@AhmadBilalDSA
AhmadBilalDSA force-pushed the fix/typing-prop-components branch from 6156865 to b3d3465 Compare September 4, 2026 10:38
@AhmadBilalDSA

AhmadBilalDSA commented Sep 4, 2026 •

Copy link
Copy Markdown
Author

Thanks for the feedback @stevepiercy and @angatha Reverted all Args: headings back to Parameters: across parser_tools.py and cal/component.py per the documentation guidelines. Updated the PR description from Fixes #1072 to See #1072. Formatted with ruff to ensure clean CI passing. Verified all unit tests pass locally with pytest."

@angatha
angatha self-requested a review September 4, 2026 10:57
@stevepiercy

Copy link
Copy Markdown
Member

@AhmadBilalDSA your edit to the description is worse. Please change it as @angatha directed, and see https://github.com/collective/icalendar/blob/main/.github/pull_request_template.md?plain=1#L14-L35 for instructions.

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@AhmadBilalDSA thanks for your first contribution to icalendar! While reviewing your changes, I found old things that also needed to be addressed that were overlooked. Would you please take care? Thank you!

Comment thread news/1749.documentation.rst Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/parser_tools.py Resolved
Comment thread src/icalendar/parser_tools.py Resolved
Comment thread src/icalendar/parser_tools.py Resolved
@AhmadBilalDSA

Copy link
Copy Markdown
Author

Hi @stevepiercy @angatha,

  1. Updated the PR description to use See #1072.
  2. Renamed the changelog fragment to news/1749.documentation.rst.
  3. Applied all requested docstring grammar and formatting improvements across cal/component.py and parser_tools.py.
  4. Added type hints and docstring updates to Component.walk (name: str | None = None, select: Callable[[Component], bool] = __identity) -> list[Component]) per Add type hints [beginner, Python, typing] #938.

@AhmadBilalDSA

Copy link
Copy Markdown
Author

@stevepiercy @angatha All requested changes have been addressed:

  1. PR Description: Formatted the issue link to Contributes to #1072 per the repository template guidelines.
  2. Docstring & Style Fixes:
    • Retained Parameters: headings across all touched docstrings.
    • Fixed docstring formatting in src/icalendar/cal/component.py (_encode, walk, get_component_class, decoded, set_inline, new).
    • Cleaned grammar and spacing without touching any runtime behavior or signatures.
  3. Changelog Fragment: Updated news/1749.documentation.rst per changelog standards.
  4. Validation: All 25 CI checks (ruff, coverage, documentation, and test matrix across Python 3.10–3.14) are passing cleanly.

Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/parser_tools.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
@angatha

angatha commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

@AhmadBilalDSA do you need assistance with the style guide?

@angatha

angatha commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@AhmadBilalDSA do you want to proceed with this?

@niccokunzmann

Copy link
Copy Markdown
Member

@angatha Since we did not get a response, I would ask you to make a decision: Would you like to merge your suggestions and merge the PR or would you like to close it?

In any case, we can open it again and the code is not lost.
We could also start recording left-over PRs in an issue and assign them to first timers to train how to take up work of other people. That would be cool. Let me know your decision!

@AhmadBilalDSA

Copy link
Copy Markdown
Author

Hi @angatha @nicokunzmann, apologies for the delay! I'm actively working on resolving the remaining requested changes today so we can get this merged. Thanks for stepping in to fix parts of it.

@angatha

angatha commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the reply. I already added my changes. You may give them a review.

@AhmadBilalDSA

Copy link
Copy Markdown
Author

Hi @angatha @nicokunzmann, I've updated the docstrings in parser_tools.py and component.py to follow Google style, pulled in the latest changes from main, and ensured all checks pass. Ready for review!

@AhmadBilalDSA
AhmadBilalDSA requested a review from angatha October 30, 2026 11:00
@angatha

angatha commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Theres still #1749 (comment) from @stevepiercy. Do you know how to address that?

@stevepiercy

Copy link
Copy Markdown
Member

I will review this after Nov 1. I have a deadline. There's still some things I'd like to clean up. Thanks for your patience.

The Parameters were not rendering correctly, but do now. This is good.

I'm not sure whether the signature can be improved. In the _build/html/reference/api directory locally, this is the only instance where I found the pattern "pre"><, which precedes a generic Python object such as function.

https://icalendar--1749.org.readthedocs.build/en/1749/reference/api/icalendar.cal.component.html#icalendar.cal.component.Component.walk

Some guidance from this explanation might be helpful to determine whether it's possible.

#1077 (comment)

@AhmadBilalDSA what do you think? Is it possible to improve how the signature renders? Please let us know. Thank you!

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a couple of questions, and the rest are suggestions for your consideration. Please let me know. Thank you!

Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/cal/component.py Resolved
Comment thread src/icalendar/parser_tools.py Resolved
Comment thread news/1749.documentation.rst Resolved
@AhmadBilalDSA

AhmadBilalDSA commented Nov 6, 2026 •

Copy link
Copy Markdown
Author

I respect your suggestions, let me know what are the changes you wanted me to do? I'll do that 100% to keep the line and code clean.

@angatha

angatha commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

There is a merge conflict. Can you please adress that?

@AhmadBilalDSA

Copy link
Copy Markdown
Author

Right now, on a phone, I'll take care of that conflict once on my machine.

@stevepiercy

Copy link
Copy Markdown
Member

@AhmadBilalDSA long phone call? 😉

Prompt: Apply the remaining review suggestions for Component.walk signature rendering, the set_inline encode flag, default value notes, and the change log entry.

Model: DeepSeek V4.1 Flash Free via opencode.

Output: this commit.
Prompt: Resolve the docstring conflict in Component._encode and Component.walk after syncing with upstream main.

Model: DeepSeek V4.1 Flash Free via opencode.

Output: this merge commit.
Prompt: Apply the remaining reviewer feedback on parameter ordering, required markers, walk select description, and the change log wording.

Model: DeepSeek V4.1 Flash Free via opencode.

Output: this commit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants