Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

(MAINT) Better error outputting to terminal #174

Merged
merged 1 commit into from
May 31, 2022

Conversation

petergmurphy
Copy link
Contributor

@petergmurphy petergmurphy commented May 24, 2022

This commit changes how errors are outputted to the terminal.
Previously, when a tool returned a non-success exit code and no stderr,
the terminal would just output an exit code. Now, when tool returns a
non-success exit code and no stderr, the stdout will be outputted to the
terminal. The tool's stdout should contain what validation errors occurred.

Before:

5:00PM INF Validating with the metadata-json-lint tool
5:00PM ERR metadata-json-lint:
Tool exited with code: 1

      TOOL NAME      | VALIDATION EXIT CODE
---------------------+-----------------------
  metadata-json-lint |                    1
5:00PM ERR Validation returned 1 error

After:

5:01PM INF Validating with the metadata-json-lint tool
5:01PM ERR metadata-json-lint:
(ERROR) required_fields: The file did not contain a required property of 'version'
Errors found in /code/metadata.json

      TOOL NAME      | VALIDATION EXIT CODE
---------------------+-----------------------
  metadata-json-lint |                    1
5:01PM ERR Validation returned 1 error

@petergmurphy petergmurphy requested a review from a team as a code owner May 24, 2022 10:21
@petergmurphy petergmurphy force-pushed the maint/main/add_better_terminal_output branch 2 times, most recently from a96c71c to 057fd84 Compare May 24, 2022 11:55
@petergmurphy petergmurphy marked this pull request as draft May 24, 2022 11:56
@petergmurphy petergmurphy reopened this May 24, 2022
@petergmurphy petergmurphy force-pushed the maint/main/add_better_terminal_output branch 3 times, most recently from dfbbd3d to 5f56a0e Compare May 25, 2022 16:52
@petergmurphy petergmurphy marked this pull request as ready for review May 25, 2022 17:02
@petergmurphy petergmurphy force-pushed the maint/main/add_better_terminal_output branch from 5f56a0e to 2ade9fe Compare May 31, 2022 10:24
This commit changes how errors are outputted to the terminal.
Previously, when a tool returned a non-success exit code and no stderr,
the terminal would just output an exit code. Now, when tool returns a
non-success exit code and no stderr, the stdout will be outputted to the
terminal. The tool's stdout should contain what validation errors occurred.

This commit also adds a change to how the code directory is
presented in the outputted text. Previously, any usage of a code directory
would have `/code/` prepended onto it as it was mounted to this docker directory.
Now PRM will find and remove any usage of `/code/` in the output text.
@petergmurphy petergmurphy force-pushed the maint/main/add_better_terminal_output branch from 2ade9fe to 41e3b20 Compare May 31, 2022 11:29
@petergmurphy petergmurphy added the enhancement New feature or request label May 31, 2022
@chelnak chelnak merged commit ecb38e9 into main May 31, 2022
@chelnak chelnak deleted the maint/main/add_better_terminal_output branch May 31, 2022 15:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants