Skip to content

Commit

Permalink
Merge branch 'master' into bats/shfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
seefood authored Nov 19, 2024
2 parents d37505b + 3c0baf5 commit 3f58bbe
Show file tree
Hide file tree
Showing 71 changed files with 2,364 additions and 552 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
bats-test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04, macos-10.15, macos-11]
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-11]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install greadlink
if: startsWith(runner.os, 'macOS')
run: brew install coreutils
Expand All @@ -26,9 +26,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install docs dependencies
Expand All @@ -40,19 +40,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.17
go-version: 1.21.0
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install shfmt
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- name: Install shellcheck
run: brew install shellcheck
env:
scversion: stable # Or latest, vxx, etc
run: |
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv "shellcheck-${scversion}/shellcheck"
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/
shellcheck --version
- name: Install pre-commit
run: python3 -m pip install -r test/lint-requirements.txt
- name: Run lint
Expand Down
6 changes: 1 addition & 5 deletions aliases/available/general.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi
alias c='clear'
alias cls='clear'

alias edit='${EDITOR:-${ALTERNATE_EDITOR?}}'
alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
alias pager='${PAGER:=less}'

alias q='exit'
Expand Down Expand Up @@ -71,10 +71,6 @@ alias rd='rmdir'
# Shorten extract
alias xt='extract'

# sudo editors
alias svim='sudo ${VISUAL:-vim}'
alias snano='sudo nano'

# Display whatever file is regular file or folder
function catt() {
for i in "$@"; do
Expand Down
46 changes: 32 additions & 14 deletions aliases/available/git.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@ about-alias 'common git abbreviations'

alias g='git'
alias get='git'
alias got='git '

# add
alias ga='git add'
alias gall='git add -A'
alias gap='git add -p'
alias gav='git add -v'

# branch
alias gb='git branch'
alias gbD='git branch -D'
alias gba='git branch -a'
alias gba='git branch --all'
alias gbd='git branch -d'
alias gbm='git branch -m'
alias gbD='git branch -D'
alias gbl='git branch --list'
alias gbla='git branch --list --all'
alias gblr='git branch --list --remotes'
alias gbm='git branch --move'
alias gbr='git branch --remotes'
alias gbt='git branch --track'
alias gdel='git branch -D'

# for-each-ref
alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC' # FROM https://stackoverflow.com/a/58623139/10362396
Expand All @@ -27,6 +32,9 @@ alias gca='git commit -v -a'
alias gcaa='git commit -a --amend -C HEAD' # Add uncommitted and unstaged changes to the last commit
alias gcam='git commit -v -am'
alias gcamd='git commit --amend'
alias gc!='git commit -v --amend'
alias gca!='git commit -v -a --amend'
alias gcn!='git commit -v --amend --no-edit'
alias gcm='git commit -v -m'
alias gci='git commit --interactive'
alias gcsam='git commit -S -am'
Expand Down Expand Up @@ -74,6 +82,8 @@ alias ggup='git log --branches --not --remotes --no-walk --decorate --oneline' #
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/
alias gwc='git whatchanged'
alias ghist='git log --pretty=format:'\''%h %ad | %s%d [%an]'\'' --graph --date=short' # Use it to be fast and without color.
alias gprogress='git log --pretty=format:'\''%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d'\'' --decorate --date=short' #Usually use "git progress" in the file .gitconfig. The new alias from Git friends will be truly welcome.

# ls-files
alias gu='git ls-files . --exclude-standard --others' # Show untracked files
Expand All @@ -92,6 +102,9 @@ fi

# merge
alias gm='git merge'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias gms='git merge --squash'

# mv
alias gmv='git mv'
Expand All @@ -102,7 +115,8 @@ alias gpatch='git format-patch -1'
# push
alias gp='git push'
alias gpd='git push --delete'
alias gpf='git push --force'
alias gpf='git push --force-with-lease'
alias gpff='git push --force'
alias gpo='git push origin HEAD'
alias gpom='git push origin $(get_default_branch)'
alias gpu='git push --set-upstream'
Expand All @@ -112,6 +126,7 @@ alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'

# pull
alias gl='git pull'
alias glp='git pull --prune'
alias glum='git pull upstream $(get_default_branch)'
alias gpl='git pull'
alias gpp='git pull && git push'
Expand All @@ -124,17 +139,21 @@ alias grv='git remote -v'

# rm
alias grm='git rm'
alias grmc='git rm --cached' # Removes the file only from the Git repository, but not from the filesystem. This is useful to undo some of the changes you made to a file before you commit it.

# rebase
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grm='git rebase $(get_default_branch)'
alias grmi='git rebase $(get_default_branch) -i'
alias grma='GIT_SEQUENCE_EDITOR=: git rebase $(get_default_branch) -i --autosquash'
alias grbm='git rebase $(get_default_branch)'
alias grbmi='git rebase $(get_default_branch) --interactive'
alias grbma='GIT_SEQUENCE_EDITOR=: git rebase $(get_default_branch) --interactive --autosquash'
alias gprom='git fetch origin $(get_default_branch) && git rebase origin/$(get_default_branch) && git update-ref refs/heads/$(get_default_branch) origin/$(get_default_branch)' # Rebase with latest remote

# reset
alias gus='git reset HEAD'
alias gus='git reset HEAD' # read as: 'git unstage'
alias grh='git reset' # equivalent to: git reset HEAD
alias grh!='git reset --hard'
alias gpristine='git reset --hard && git clean -dfx'

# status
Expand All @@ -147,6 +166,8 @@ alias gsl='git shortlog -sn'

# show
alias gsh='git show'
alias gshn='git show --name-only'
alias gshns='git show --name-status'

# svn
alias gsd='git svn dcommit'
Expand Down Expand Up @@ -199,9 +220,6 @@ function gdv() {
}

function get_default_branch() {
if git branch | grep -q '^. main\s*$'; then
echo main
else
echo master
fi
branch=$(git symbolic-ref refs/remotes/origin/HEAD)
${branch#refs/remotes/origin/}
}
30 changes: 13 additions & 17 deletions aliases/available/kubectl.aliases.bash
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# shellcheck shell=bash
about-alias 'kubectl aliases'

function _set_pkg_aliases() {
if _command_exists kubectl; then
alias kc='kubectl'
alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments'
alias kcgn='kubectl get nodes'
alias kcdp='kubectl describe pod'
alias kcdd='kubectl describe deployment'
alias kcdn='kubectl describe node'
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi
}

_set_pkg_aliases
if _command_exists kubectl; then
alias kc='kubectl'
alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments'
alias kcgn='kubectl get nodes'
alias kcdp='kubectl describe pod'
alias kcdd='kubectl describe deployment'
alias kcdn='kubectl describe node'
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi
13 changes: 12 additions & 1 deletion aliases/available/maven.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ about-alias 'maven abbreviations'

alias mci='mvn clean install'
alias mi='mvn install'
alias mcp='mvn clean package'
alias mc='mvn clean'
alias mct='mvn clean test'
alias mcc='mvn clean compile'
alias mccnt='mvn clean compile -DskipTests=true'
alias mp='mvn package'
alias mcp='mvn clean package'
alias mcpnt='mvn clean package -DskipTests=true'
alias mrprep='mvn release:prepare'
alias mrperf='mvn release:perform'
alias mrrb='mvn release:rollback'
alias mdep='mvn dependency:tree'
alias mpom='mvn help:effective-pom'
alias mcisk='mci -Dmaven.test.skip=true'
alias mcpsk='mcp -Dmaven.test.skip=true'

# Maven service plugin aliases
alias mspring='mvn spring-boot:run'
alias mjetty='mvn jetty:run'
alias mquark='mvn quarkus:dev'
alias mmicro='mvn mn:run'
1 change: 1 addition & 0 deletions aliases/available/osx.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ alias safari='open -a safari'
alias firefox='open -a firefox'
alias chrome='open -a "Google Chrome"'
alias chromium='open -a chromium'
alias brave='open -a "Brave Browser"'
alias dashcode='open -a dashcode'
alias f='open -a Finder '
alias fh='open -a Finder .'
Expand Down
2 changes: 2 additions & 0 deletions aliases/available/terraform.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
about-alias 'Aliases for Terraform and Terragrunt'

alias tf='terraform'
alias tfi='tf init'
alias tfv='terraform validate'
alias tfp='terraform plan'
alias tfa='terraform apply'
alias tfd='terraform destroy'
alias tfw='terraform workspace'
33 changes: 21 additions & 12 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
aliases/
docs/
hooks/
lib/
scripts/
test/

Expand All @@ -32,8 +33,10 @@ lint_clean_files.sh

# completions
#
completion/available/aliases.completion.bash
completion/available/apm.completion.bash
completion/available/awless.completion.bash
completion/available/awscli.completion.bash
completion/available/bash-it.completion.bash
completion/available/brew.completion.bash
completion/available/cargo.completion.bash
Expand All @@ -46,6 +49,8 @@ completion/available/dmidecode.completion.bash
completion/available/docker-machine.completion.bash
completion/available/docker.completion.bash
completion/available/dotnet.completion.bash
completion/available/export.completion.bash
completion/available/flutter.completion.bash
completion/available/gcloud.completion.bash
completion/available/gem.completion.bash
completion/available/git.completion.bash
Expand Down Expand Up @@ -75,18 +80,7 @@ completion/available/system.completion.bash
completion/available/vault.completion.bash
completion/available/vuejs.completion.bash
completion/available/wpscan.completion.bash

# libraries
lib/appearance.bash
lib/colors.bash
lib/command_duration.bash
lib/helpers.bash
lib/history.bash
lib/log.bash
lib/preexec.bash
lib/preview.bash
lib/search.bash
lib/utilities.bash
completion/available/yarn.completion.bash

# plugins
#
Expand All @@ -96,6 +90,7 @@ plugins/available/base.plugin.bash
plugins/available/basher.plugin.bash
plugins/available/battery.plugin.bash
plugins/available/blesh.plugin.bash
plugins/available/browser.plugin.bash
plugins/available/cmd-returned-notify.plugin.bash
plugins/available/colors.plugin.bash
plugins/available/direnv.plugin.bash
Expand All @@ -113,6 +108,7 @@ plugins/available/history.plugin.bash
plugins/available/hub.plugin.bash
plugins/available/java.plugin.bash
plugins/available/jekyll.plugin.bash
plugins/available/jgitflow.plugin.bash
plugins/available/jump.plugin.bash
plugins/available/latex.plugin.bash
plugins/available/less-pretty-cat.plugin.bash
Expand All @@ -132,9 +128,16 @@ plugins/available/rbenv.plugin.bash
plugins/available/ruby.plugin.bash
plugins/available/textmate.plugin.bash
plugins/available/todo.plugin.bash
plugins/available/url.plugin.bash
plugins/available/xterm.plugin.bash
plugins/available/zoxide.plugin.bash

# tests
#
test/completion/aliases.completion.bats
test/run
test/test_helper.bash

# themes
#
themes/90210
Expand All @@ -151,17 +154,23 @@ themes/bobby-python
themes/brainy
themes/brunton
themes/candy
themes/clean
themes/easy
themes/elixr
themes/essential
themes/githelpers.theme.bash
themes/inretio
themes/lambda
themes/modern
themes/norbu
themes/oh-my-posh
themes/p4helpers.theme.bash
themes/pete
themes/powerline
themes/pure
themes/purity


# vendor init files
#
vendor/.gitattributes
Loading

0 comments on commit 3f58bbe

Please sign in to comment.