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

Add support for filenames with spaces #40

Merged
merged 7 commits into from
Apr 29, 2021

Conversation

rasa
Copy link
Contributor

@rasa rasa commented Jan 30, 2021

This PR adds the following features:

  1. Adds support for filenames with spaces
  2. Allows user to set flag with 1, true, on, or yes (case insensitively)
  3. Lists files that are being excluded
  4. Lists number of files that are being scanned
  5. Replaces most echos with printf. See https://mywiki.wooledge.org/BashPitfalls?highlight=%28echo%29#echo_.24foo
  6. Includes the shellcheck/shopt options in the log
  7. Adds instructions on how to correct the issues found
  8. Passes all shellcheck and shfmt's checks
  9. Returns an exit code which binary ORs shellcheck's/shopt's/checkbashism's exit codes

I've tested everything including the SH_CHECKER_COMMENT logic.

Copy link

@haraldh haraldh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it :)

@luizm luizm merged commit c0221cb into luizm:master Apr 29, 2021
@luizm
Copy link
Owner

luizm commented Apr 29, 2021

https://github.com/luizm/action-sh-checker/releases/tag/v0.2.0

It is a pre-release

I did a quick validation and it seems good, @rasa @haraldh if you could use this version as well I really appreciate it.

@haraldh
Copy link

haraldh commented Apr 29, 2021

 Validating 406 shell script(s) using 'shellcheck ':
'shellcheck ' found no issues.
Validating 406 shell script(s) using 'shfmt -s':
'shfmt -s' found no issues.

https://github.com/dracutdevs/dracut/pull/1414/checks?check_run_id=2467329776

haraldh added a commit to dracutdevs/dracut that referenced this pull request Apr 29, 2021
if [ "$SHFMT_DISABLE" != "1" ]; then
echo -e "Validating shell scripts files using shfmt\n"
# shellcheck disable=SC2086
shfmt_error="$(eval shfmt $SHFMT_OPTS -d $sh_files)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lost the -d, per #44

@rasa rasa deleted the rasa/spaces-in-filenames branch October 24, 2023 15:09
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.

3 participants