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

Search collections installed via package manager as well #130

Merged
merged 2 commits into from Feb 11, 2022
Merged

Search collections installed via package manager as well #130

merged 2 commits into from Feb 11, 2022

Conversation

stove-panini
Copy link
Contributor

I noticed that the snippet generator wasn't finding modules in collections that are installed via package manager (ansible-collections-ansible-posix in Fedora, for example).

I changed up get_files_user() to a more general get_files_collections() to search system collections by default and user collections when supplying user: True to the function.

@pearofducks
Copy link
Owner

This seems like an OK change, but I would like to make the default search the user directory so this isn't a breaking change for people relying on the current behavior.

collection_name = get_collection_name(f)
docstring_system['collection_name'] = collection_name
modules_docstrings.append(docstring_system)

if args.user:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default behavior for --user remains the same since get_files_collections(user=True) is behind this if statement.

@stove-panini
Copy link
Contributor Author

The default behavior was to ignore the user directory unless the --user option is passed. This hasn't changed. The only new default functionality is to include the system collection directory, but I'm fine with putting that behind an option as well

@pearofducks pearofducks merged commit 93798e8 into pearofducks:master Feb 11, 2022
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.

None yet

2 participants