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

Ruby documentation step 1: placeholders and checks #1683

Draft
wants to merge 51 commits into
base: master
Choose a base branch
from

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Apr 10, 2024

Pull Request Description

Addresses #1682.

Adds cops:

  • Style/Documentation
  • Style/DocumentationMethod

Exclude non "resource" files (and hpxml.rb) from these cops. Stub documentation for all included classes/methods.

Adds a new "Check measures" step to the run-unit-tests GHA job. The step runs update_measures and exits if:

  • its output contains "RuboCop failed" (e.g., any undocumented classes/methods/etc), or
  • there are any *.rb or *.xml file differences

Add a new test for reporting documentation coverages.

Checklist

PR Author: Check these when they're done. Not all may apply. strikethrough and check any that do not apply.

PR Reviewer: Verify each has been completed.

  • Schematron validator (EPvalidator.xml) has been updated
  • Sample files have been added/updated (openstudio tasks.rb update_hpxmls)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests/test*.rb and/or workflow/tests/test*.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

@joseph-robertson joseph-robertson self-assigned this Apr 10, 2024
@joseph-robertson
Copy link
Collaborator Author

Let's script (or otherwise pre-populate) each of the method's tags/docstrings and get that merged up front. This would:

  • help to alleviate ongoing merge conflicts with the master branch
  • allow users the opportunity to update the placeholder docs in the meantime

stub-docs.rb Outdated Show resolved Hide resolved
stub-docs.rb Outdated

require_relative file

new_classes = ObjectSpace.each_object(Class).to_a - previous_classes
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Admittedly, running into trouble using this approach of trying to require the file and then get classes/methods out of it. Repeated/nested class/method names cause issues. Instead of getting the script to operate perfectly, it may be a more effective use of time to take over with manual edits.

Copy link
Contributor

Choose a reason for hiding this comment

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

Go with whatever it easiest. I assume the script is temporary and will be deleted before merging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I was only planning to use it as a temporary helper script.

@joseph-robertson joseph-robertson changed the title Ruby documentation Ruby documentation step 1: placeholders and checks May 15, 2024
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