Skip to content

Description should be empty when it is missing in ModuleFile #769

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

adityapatwardhan
Copy link
Member

PR Summary

This pull request enhances the handling of module file descriptions in the Markdown reader, improves test coverage for scenarios where descriptions are missing, and adds a new module file asset for testing purposes. The most important changes include refining the logic for handling missing descriptions, updating tests to reflect new functionality, and adding a new test asset.

Improvements to Markdown Reader Logic:

  • src/MarkdownReader/ModuleFileMarkdownReader.cs: Updated the GetModuleFileDescriptionFromMarkdown method to handle cases where descriptions are missing. Added diagnostic warnings when no description is found and ensured the method returns an empty string in such cases.

Test Coverage Enhancements:

  • test/Pester/ImportMarkdownModuleFile.Tests.ps1: Added a new test case to verify that module files can be parsed even when the description is missing. Updated existing tests to account for the new module file asset, increasing the expected count of module files from 14 to 15. [1] [2]
  • test/Pester/MeasurePlatyPSMarkdown.Tests.ps1: Updated test cases to reflect the addition of the new module file asset, increasing the expected count for ModuleFile from 15 to 16 and for V1Schema from 51 to 52.

Addition of New Test Asset:

PR Context

Fixes #760

@adityapatwardhan
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@sdwheeler sdwheeler left a comment

Choose a reason for hiding this comment

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

LGTM

@adityapatwardhan adityapatwardhan merged commit 8e23dec into main Jul 16, 2025
8 checks passed
@adityapatwardhan adityapatwardhan deleted the ImportMDEmptyDesc branch July 16, 2025 17:22
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.

Import-MarkdownModuleFile doesn't handle empty description section
2 participants