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

refactor: git pre-commit cleanups #70

Merged
merged 1 commit into from
Jun 16, 2020
Merged

refactor: git pre-commit cleanups #70

merged 1 commit into from
Jun 16, 2020

Conversation

rchildre3
Copy link
Contributor

  • Recommend using git config "hooksPath" over cp to pick up changes in
    hooks folder.
  • Use strict shell programming with -e (Abort script at first error) and
    -u (Treat unset variables and parameters as an error at expansion).
  • Only check for Shellcheck if changes to shell scripts are to be
    committed.
  • Use git diff-index as the example git pre-commit examples do.
  • Aggregate all changed shell scripts into one call to Shellcheck for a
    minor speed improvement (0.5 sec improvement for 100 shell scripts)
  • Use POSIX compliant call to head with -n option
  • Improve grep call
    • Do not rely on extended patterns
    • POSIX recommends -e with single quotes
    • Shellcheck does not check [t]csh scripts
  • Add check with Git's default whitespace checker
  • Apply Shellcheck to all files in repo.

* Recommend using git config "hooksPath" over `cp` to pick up changes in
  hooks folder.
* Use strict shell programming with -e (Abort script at first error) and
  -u (Treat unset variables and parameters as an error at expansion).
* Only check for Shellcheck if changes to shell scripts are to be
  committed.
* Use git diff-index as the example git pre-commit examples do.
* Aggregate all changed shell scripts into one call to Shellcheck for a
  minor speed improvement (0.5 sec improvement for 100 shell scripts)
* Use POSIX compliant call to head with -n option
* Improve grep call
  * Do not rely on extended patterns
  * POSIX recommends -e with single quotes
  * Shellcheck does not check [t]csh scripts
* Add check with Git's default whitespace checker
* Apply Shellcheck to all files in repo.
@scottyhardy
Copy link
Owner

Awesome work, thanks muchly for your contribution @rchildre3

@scottyhardy scottyhardy merged commit 3a82d4f into scottyhardy:master Jun 16, 2020
@rchildre3 rchildre3 deleted the feature/pre-commit-refactor branch June 17, 2020 03: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.

2 participants