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

Update check method docs #18347

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

bwatters-r7
Copy link
Contributor

Internally and in reviews, we tell contributors not to use fail_with because we should always do our best to make sure a check method returns a check code. I noticed that #18283 had a fail_with and went to pull the relevant citation in our documentation and found it was not there. This just adds the guidance and reasoning not to exit a check method without returning a check code.

@bcoles
Copy link
Contributor

bcoles commented Sep 6, 2023

There's an additional historical reason behind not using fail_with, in that module check should never output anything except the CheckCode unless verbose output is enabled.

https://docs.metasploit.com/docs/development/developing-modules/guides/how-to-write-a-check-method.html#check-method-output

@cgranleese-r7 cgranleese-r7 self-assigned this Sep 11, 2023
@cgranleese-r7
Copy link
Contributor

Looks good to me 👍
image

@cgranleese-r7 cgranleese-r7 added the rn-documentation release notes for Metasploit Framework documentation label Oct 3, 2023
@cgranleese-r7 cgranleese-r7 merged commit 92867ce into rapid7:master Oct 3, 2023
33 checks passed
@cgranleese-r7
Copy link
Contributor

cgranleese-r7 commented Oct 3, 2023

Release Notes

This PR updates the how-to-write-a-check-method docs to now better explain to not use fail_with as it's best practice to make sure a check method returns a check code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-documentation release notes for Metasploit Framework documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants