-
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.
Merge branch 'main' into feature/link-issues
- Loading branch information
Showing
20 changed files
with
215 additions
and
665 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 |
---|---|---|
@@ -1,22 +1,31 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
reviewers: | ||
- "SituDevelopment/employees" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
interval: "weekly" | ||
time: "13:00" | ||
timezone: "Australia/Brisbane" | ||
|
||
- package-ecosystem: "npm" | ||
reviewers: | ||
- "SituDevelopment/employees" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
interval: "weekly" | ||
time: "13:00" | ||
timezone: "Australia/Brisbane" | ||
|
||
- package-ecosystem: "pip" | ||
reviewers: | ||
- "SituDevelopment/employees" | ||
directory: "/" | ||
groups: | ||
pydantic: | ||
patterns: | ||
- "pydantic" | ||
- "pydantic-core" | ||
pylint: | ||
patterns: | ||
- "astroid" | ||
- "pylint" | ||
schedule: | ||
interval: "daily" | ||
interval: "weekly" | ||
time: "13:00" | ||
timezone: "Australia/Brisbane" |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Provides autocompletion for the `branch`, `bugfix-branch`, `chore-branch` and `feature-branch` commands. | ||
|
||
function _remove_from_array() { | ||
local array=("$@") | ||
local remove=$1 | ||
local new_array=() | ||
for i in "${array[@]}"; do | ||
if [[ ${i} != ${remove} ]]; then | ||
new_array+=(${i}) | ||
fi | ||
done | ||
echo ${new_array[@]} | ||
unset new_array | ||
} | ||
|
||
function _branch() { | ||
cur=${COMP_WORDS[${COMP_CWORD}]} | ||
prev=${COMP_WORDS[${COMP_CWORD}-1]} | ||
|
||
# branch [-r] [-o <owner>] [-b <base-branch>] <repository> <branch-name> | ||
options="-r -o -b" | ||
option_offset=0 | ||
|
||
owner="SituDevelopment" | ||
for ((i=1; i<${#COMP_WORDS[@]}; i++)); do | ||
case ${COMP_WORDS[$i]} in | ||
-r) | ||
options=$(_remove_from_array "-r" ${options}) | ||
option_offset=$((${option_offset}+1)) | ||
;; | ||
-o) | ||
options=$(_remove_from_array "-o" ${options}) | ||
option_offset=$((${option_offset}+2)) | ||
owner=${COMP_WORDS[$i+1]} | ||
;; | ||
-b) | ||
options=$(_remove_from_array "-b" ${options}) | ||
option_offset=$((${option_offset}+2)) | ||
base_branch=${COMP_WORDS[$i+1]} # TODO: autocomplete base-branch based off of owner and repository | ||
;; | ||
esac | ||
done | ||
|
||
# complete option | ||
if [[ "${cur}" == "-*" ]]; then | ||
COMPREPLY=($(compgen -W "${options}" -- "${cur}")) | ||
return | ||
fi | ||
|
||
# complete repository | ||
if [[ ${COMP_CWORD} -eq $((${option_offset}+1)) ]]; then | ||
if bkt --discard-failures -- gh api /orgs/${owner} --silent 2> /dev/null; then | ||
# owner is an org | ||
repos=$(bkt --discard-failures -- gh api "/orgs/${owner}/repos?per_page=100" --jq '.[].name' 2> /dev/null) | ||
elif bkt --discard-failures -- gh api /users/${owner} --silent 2> /dev/null; then | ||
# owner is a user | ||
repos=$(bkt --discard-failures -- gh api "/users/${owner}/repos?per_page=100" --jq '.[].name' 2> /dev/null) | ||
else | ||
# owner does not exist | ||
repos="" | ||
fi | ||
|
||
COMPREPLY=($(compgen -W "${repos} ${options}" -- "${cur}")) | ||
fi | ||
|
||
# complete base-branch | ||
if [[ "${prev}" == "-b" ]]; then | ||
repo=${COMP_WORDS[$((${option_offset}+1))]} | ||
branches=$(bkt --discard-failures -- gh api "/repos/${owner}/${repo}/branches" --jq '.[].name' 2> /dev/null) | ||
COMPREPLY=($(compgen -W "${branches}" -- "${cur}")) | ||
fi | ||
} | ||
|
||
complete -F _branch branch bugfix-branch chore-branch feature-branch |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# | ||
# Initialises autocompletion for the Automation suite. | ||
|
||
export BKT_TTL="1m" | ||
export BKT_SCOPE="$$" | ||
|
||
completions=(branch create-pr) | ||
|
||
for completion in ${completions[@]}; do | ||
if [ -f "./${completion}.completion" ]; then | ||
source "./${completion}.completion" | ||
fi | ||
done | ||
|
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Provides autocompletion for the `create-pr` command. | ||
|
||
|
||
function _create-pr() { | ||
cur=${COMP_WORDS[${COMP_CWORD}]} | ||
|
||
# create-pr [-b <base-branch>] [<label> ...] | ||
options="-b" | ||
|
||
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" != "true" ]]; then | ||
# Not in a git repository | ||
return | ||
fi | ||
|
||
# create-pr [-b <base-branch>] [<label> ...] | ||
if [[ ${COMP_CWORD} -eq 2 && "${cur}" == "-b" ]]; then | ||
# Complete the base branch | ||
branches=$(bkt --discard-failures -- gh api /repos/$(git remote get-url origin | sed 's/^git@github.com://' | sed 's/.git$//g')/branches --jq '.[].name') | ||
COMPREPLY=($(compgen -W "${branches}" -- "${cur}")) | ||
else | ||
# Complete the labels | ||
labels=$(bkt --discard-failures -- gh label list --json name --jq '.[].name' 2> /dev/null) | ||
if [[ ${COMP_CWORD} -eq 1 ]]; then | ||
COMPREPLY=($(compgen -W "${labels} ${options}" -- "${cur}")) | ||
else | ||
COMPREPLY=($(compgen -W "${labels}" -- "${cur}")) | ||
fi | ||
fi | ||
} | ||
|
||
complete -F _create-pr create-pr |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.