Skip to content

Conversation

@Kurt-von-Laven
Copy link
Contributor

@Kurt-von-LavenKurt-von-Laven commented May 7, 2022

Draw inspiration from Shellcheck.

  • Simplify command-line construction by building up arrays rather than passing empty strings via unquoted variables (c.f., SC2206).
  • Prefer [[ ]] to [ ] to prevent globbing and word splitting in tests.
  • Quote Bash variables elsewhere to prevent globbing and word splitting (c.f., SC2086).
  • Reorder code to start with set directive, fail fast, and colocate related sections.
  • Use consistent style recommended by shfmt for if/then/else blocks.
  • Use UPPER_CASE consistently for variable names.
  • Use single quotes consistently for string literals.
  • Use curly braces to delimit variables from surrounding string literals but not in isolation.

Fixes#28.

@Kurt-von-LavenKurt-von-Laven changed the title fix(entrypoint): Follow Bash best practicesfix: Follow Bash best practices in entrypointMay 7, 2022
@Kurt-von-LavenKurt-von-Lavenforce-pushed the quote-variables branch 2 times, most recently from 08bc49a to b4d99c2CompareMay 10, 2022 18:52
- Simplify command-line construction by building up arrays rather than passing empty strings via unquoted variables. - Prefer [[ ]] to [ ] to prevent globbing and word splitting in tests. - Quote Bash variables elsewhere to prevent globbing and word splitting. - Reorder code to start with set directive, fail fast, and colocate related sections. - Use consistent style recommended by shfmt for if/then/else blocks. - Use UPPER_CASE consistently for variable names. - Use single quotes consistently for string literals. - Use curly braces to delimit variables from surrounding string literals but not in isolation.
@woilewoile merged commit 5d5be47 into commitizen-tools:masterMay 11, 2022
@woile
Copy link
Member

@Kurt-von-LavenKurt-von-Laven deleted the quote-variables branch May 11, 2022 08:42
@Kurt-von-Laven
Copy link
ContributorAuthor

Yikes; thanks for the heads up. I've opened #35 to address this matter.

Sign up for freeto 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.

Quote Bash Variables

2 participants

@Kurt-von-Laven@woile