Skip to content

Task: Add # may vary tag to random output, and automate line length issues  #96

Description

@bmwoodruff

Description:

The current reviewtools.py file process_text_block does not check for

  • lines longer than 79
  • random output

This causes two problems:

  1. When running spin lint, the generated examples will fail if longer than 79 characters (thanks @jud-sdev for help in Review: AI Gen Examples for ma.dot, ma.cumsum and ma.prod #87).
  2. When running python tools/refguide_check --doctests, random output will fail (thanks @ogidig5 for help in Review: AI Gen Examples for numpy.linalg.svdvals function #86).

I'd like to automate much of this.

  • I have to find a good way to reformat python code (I'm sure there is a package out there that will reformat code to stay within a specified length. I already know how to use a textwrapping function in the commit_message_creator function, which will handle regular text just fine. The issue will be formatting python code (and I'm sure it's been done).
  • I'll play with a few options for detecting random (search for rand, then expand it to np.rand or other things till it captures exactly what's needed.)
  • Update reviewtools.py with two new functions to do this.

Acceptance Criteria:

  • Random output is appropriately tagged in reviewtools.py
  • Lines longer than 79 characters are appropriately split into shorter lines, resulting in still valid python code.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions