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 autodetection of shell scripts in DEBUG mode 🥝 #299

Merged
merged 1 commit into from Aug 17, 2023

Conversation

jamacku
Copy link
Member

@jamacku jamacku commented Aug 17, 2023

In DEBUG mode, head and grep was incorrectly called with ''.

This caused warnings like:
grep: ^\s*((#|!)|(#\s*!)|(!\s*#))\s*(/usr(/local)?)?/bin/(env\s+)?(sh|ash|bash|dash|ksh|bats)\b: No such file or directory

In the end, Differential ShellCheck, in some cases, couldn't identify shell scripts correctly in DEBUG mode.

@jamacku jamacku added this to the v5.0.0 milestone Aug 17, 2023
@jamacku jamacku self-assigned this Aug 17, 2023
@mergify mergify bot added the source label Aug 17, 2023
@jamacku jamacku linked an issue Aug 17, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #299 (91dc9e3) into main (aeb8b25) will increase coverage by 0.55%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #299      +/-   ##
==========================================
+ Coverage   84.28%   84.83%   +0.55%     
==========================================
  Files           4        4              
  Lines         280      277       -3     
==========================================
- Hits          236      235       -1     
+ Misses         44       42       -2     
Files Changed Coverage Δ
src/functions.sh 84.39% <100.00%> (+1.06%) ⬆️

In DEBUG mode, `head` and `grep` was incorrectly called with `''`.

This caused warnings like:
`grep: ^\s*((#|!)|(#\s*!)|(!\s*#))\s*(/usr(/local)?)?/bin/(env\s+)?(sh|ash|bash|dash|ksh|bats)\b: No such file or directory`

In the end, Differential ShellCheck, in some cases, couldn't identify
shell scripts correctly in DEBUG mode.
@jamacku jamacku merged commit f4325e6 into redhat-plumbers-in-action:main Aug 17, 2023
9 checks passed
@jamacku jamacku deleted the grep-debug branch August 17, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make debug mode more useful, especially the grep verbose output 🔔
1 participant