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

fix: how --json parameter output is handled #608

Merged
merged 4 commits into from
May 22, 2023

Conversation

scolladon
Copy link
Owner

@scolladon scolladon commented May 17, 2023

Explain your changes


Returned the result object so --json handler can use it to display result when the flag is set

Does this close any currently open issues?


closes #568

  • Jest tests added to cover the fix.
  • NUT tests added to cover the fix.
  • E2E tests added to cover the fix.

This fix will not handle the warning in the error array.
The git diff command in this case does not throw an error (exit code is 0) but write the warning message in stderr
We catch every error message from stderr to treat those as error and stop execution, by design.

@scolladon scolladon requested a review from mehdicherf as a code owner May 17, 2023 15:29
@codeclimate
Copy link

codeclimate bot commented May 17, 2023

Code Climate has analyzed commit cfac679 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 6 0 0.1s
✅ COPYPASTE jscpd yes no 3.56s
✅ JAVASCRIPT eslint 69 0 0 6.02s
✅ JAVASCRIPT prettier 69 0 0 3.24s
✅ JSON eslint-plugin-jsonc 19 0 0 1.92s
✅ JSON jsonlint 19 0 0.17s
✅ JSON npm-package-json-lint yes no 0.48s
✅ JSON prettier 19 0 0 0.45s
✅ JSON v8r 19 0 9.89s
✅ MARKDOWN markdownlint 10 0 0 0.7s
❌ MARKDOWN markdown-link-check 10 1 16.76s
✅ MARKDOWN markdown-table-formatter 10 0 0 0.26s
✅ REPOSITORY checkov yes no 12.16s
✅ REPOSITORY gitleaks yes no 2.75s
✅ REPOSITORY git_diff yes no 0.02s
✅ REPOSITORY secretlint yes no 1.42s
✅ REPOSITORY trivy yes no 4.93s
✅ SPELL cspell 129 0 5.57s
✅ TYPESCRIPT eslint 2 0 0 1.77s
✅ YAML prettier 12 1 0 0.46s
✅ YAML v8r 12 0 16.42s
✅ YAML yamllint 12 0 0.29s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (27de245) 100.00% compared to head (cfac679) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #608   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines          898       898           
=========================================
  Hits           898       898           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@scolladon scolladon merged commit 3484e31 into main May 22, 2023
@scolladon scolladon deleted the fix/json-parameter-output branch May 22, 2023 08:02
@github-actions
Copy link

Shipped in release v5.20.0.
You can install the new version using the version number or the latest-rc channel

$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install [email protected]

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.

error output must be added to stdout when using --json
2 participants