Fix: fix mock_modules generated stubs failing YAML/doc parsing #5031#5032
Open
santosh7676 wants to merge 4 commits intoansible:mainfrom
Open
Fix: fix mock_modules generated stubs failing YAML/doc parsing #5031#5032santosh7676 wants to merge 4 commits intoansible:mainfrom
santosh7676 wants to merge 4 commits intoansible:mainfrom
Conversation
Author
|
Looks like CI Issue, it is failing in test_import_tasks[1] (Runner lintables count for examples/playbooks/test_import_with_malformed.yml), in both py314-devel and py312-devel jobs. This PR only changes:
So this appears unrelated/pre-existing. |
Contributor
|
Yep, the CI seems to be broken at the moment... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
mock_modulesgenerated stubs failing YAML/doc parsingThis MR fixes a bug where
mock_modulesgenerated Python stubs could fail ansible-lint checks due to invalid module-doc block content.Problem
When using
mock_modules, generated stubs used:EXAMPLES = '''mocked'''RETURN = '''mocked'''In some environments/paths, these values triggered YAML/module-doc parsing failures and caused lint errors on generated mock module files.
Fix
EXAMPLESRETURN(r"""+# """)Tests
test/test_mockings.pyto cover themock_modulesscenario and ensure generated stubs are lintable.#5013