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

Handle non-zero exit status when formatting using shfmt #1163

Conversation

chris-reeves
Copy link
Contributor

Non-zero exist statuses from shfmt weren't checked for or handled. As a result the (empty) output from shfmt was returned as the formatted document. An exception is now thrown when a non-zero exit status is encountered.

Fixes #1162

Non-zero exist statuses from `shfmt` weren't checked for or handled. As
a result the (empty) output from `shfmt` was returned as the formatted
document. An exception is now thrown when a non-zero exit status is
encountered.

Fixes bash-lsp#1162
Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 81.21%. Comparing base (1fc9819) to head (921fa36).
Report is 1 commits behind head on main.

❗ Current head 921fa36 differs from pull request most recent head 522a5d6. Consider uploading reports for the commit 522a5d6 to get more accurate results

Files Patch % Lines
server/src/shfmt/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1163      +/-   ##
==========================================
+ Coverage   81.19%   81.21%   +0.02%     
==========================================
  Files          29       29              
  Lines        1409     1411       +2     
  Branches      334      335       +1     
==========================================
+ Hits         1144     1146       +2     
  Misses        218      218              
  Partials       47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skovhus skovhus enabled auto-merge May 15, 2024 06:21
@skovhus skovhus merged commit 84dccb5 into bash-lsp:main May 15, 2024
4 checks passed
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.

Formatting files using shfmt results in an empty file when shfmt can't parse the file
2 participants