-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: adding source code shell formatting (#35)
Closes #27
- Loading branch information
1 parent
46674b9
commit 5cb454b
Showing
6 changed files
with
63 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ golang-base: | |
shell-formatting-base: | ||
FROM +golang-base | ||
RUN go install mvdan.cc/sh/v3/cmd/[email protected] | ||
DO +COPY_CI_DATA | ||
DO +COPY_SOURCECODE | ||
|
||
|
||
check-shell-formatting: | ||
|
@@ -50,6 +50,7 @@ yaml-formatting-base: | |
COPY ".yamlfmt" ".yamlfmt" | ||
DO +COPY_CI_DATA | ||
|
||
|
||
check-yaml-formatting: | ||
FROM +yaml-formatting-base | ||
RUN ./ci/check-yaml-formatting.sh | ||
|
@@ -61,9 +62,11 @@ check-formatting: | |
|
||
|
||
fix-shell-formatting: | ||
FROM +sh-formatting-base | ||
FROM +shell-formatting-base | ||
RUN ./ci/fix-shell-formatting.sh | ||
SAVE ARTIFACT "./ci" AS LOCAL "./ci" | ||
SAVE ARTIFACT "./src" AS LOCAL "./src" | ||
SAVE ARTIFACT "zsh-simple-abbreviations.zsh" AS LOCAL "zsh-simple-abbreviations.zsh" | ||
|
||
|
||
fix-yaml-formatting: | ||
|
@@ -94,7 +97,8 @@ check-github-actions-workflows-linting: | |
|
||
COPY_SOURCECODE: | ||
COMMAND | ||
COPY "./zsh-simple-abbreviations.zsh" "./zsh-simple-abbreviations.zsh" | ||
DO +COPY_CI_DATA | ||
COPY "./zsh-simple-abbreviations.zsh" "./zsh-simple-abbreviations.zsh" | ||
COPY "./src" "./src" | ||
COPY "./end-to-end-tests" "./end-to-end-tests" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# Only run if executed in Zsh environment. | ||
if [[ -n "${ZSH_VERSION}" ]]; then | ||
# Create new abbreviations map. | ||
typeset -Ag ZSH_SIMPLE_ABBREVIATIONS | ||
if [[ -n ${ZSH_VERSION} ]]; then | ||
# Create new abbreviations map. | ||
typeset -Ag ZSH_SIMPLE_ABBREVIATIONS | ||
|
||
fpath+=${0:A:h}/src | ||
autoload -Uz zsh-simple-abbreviations | ||
fpath+=${0:A:h}/src | ||
autoload -Uz zsh-simple-abbreviations | ||
|
||
# Create key binding on space to expand into a possible abbreviations. | ||
autoload -Uz __zsh_simple_abbreviations_expand | ||
zle -N __zsh_simple_abbreviations_expand | ||
bindkey " " __zsh_simple_abbreviations_expand | ||
# Create key binding on space to expand into a possible abbreviations. | ||
autoload -Uz __zsh_simple_abbreviations_expand | ||
zle -N __zsh_simple_abbreviations_expand | ||
bindkey " " __zsh_simple_abbreviations_expand | ||
|
||
# Create key binding on control + space to insert a space without any possible abbreviations expansion. | ||
autoload -Uz __zsh_simple_abbreviations_insert_space | ||
zle -N __zsh_simple_abbreviations_insert_space | ||
bindkey "^ " __zsh_simple_abbreviations_insert_space | ||
# Create key binding on control + space to insert a space without any possible abbreviations expansion. | ||
autoload -Uz __zsh_simple_abbreviations_insert_space | ||
zle -N __zsh_simple_abbreviations_insert_space | ||
bindkey "^ " __zsh_simple_abbreviations_insert_space | ||
fi |