Skip to content

test: refactor BuildOptions func in tools/test.py

The BuildOptions() function in tools/test.py was in unordered manner. This commit formats the function in the following ways:

  • options have been reordered enumerated lexicographically
  • individual arguments in the options have been reordered lexicographically
  • help text strings (lines over 79 chars) have been wrapped to follow the pep8 guideline [1]
  • all lines now follow the pep8 guideline [2]

These formatting changes improve the readability and maintainability of the code. For example, when a new developer wants to add a new option or change existing option or its arguments, will be able to easily find the appropriate place for that option. She will also be able to parse existing options and their arguments to check if an option already exists or see what suitable arguments can be added to the new option. The new formatting sets up a template like structure for the BuildOptions() function, for easier future development.

Also, a couple of grammatical corrections as per the suggestion on the review.

The change is concise and non-impacting - behavior of tests or the script will not change.

[1] https://www.python.org/dev/peps/pep-0008/#maximum-line-length [2] https://www.python.org/dev/peps/pep-0008/#indentation

Fixes: https://github.com/nodejs/node/issues/16342

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
  • test

Merge request reports

Loading