Skip to content

Commit

Permalink
Use lintball v2
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahr committed Nov 6, 2024
1 parent e24c8a2 commit cb2d0c7
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''
assignees: ""
---

**Describe the bug**
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
title: ""
labels: enhancement
assignees: ''
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
3 changes: 1 addition & 2 deletions .lintballrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@
"shellcheck": true,
"shfmt": true,
"yamllint": true
},
"ignores": ["*/.git/*", "*/venv/*", "*/src/*"]
}
}
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC2154,SC2312,SC2310
4 changes: 2 additions & 2 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
yaml-files:
- '*.yaml'
- '*.yml'
- "*.yaml"
- "*.yml"

rules:
braces: enable
Expand Down
8 changes: 4 additions & 4 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ asdf_nim_install() {
step_start "cp to ${ASDF_NIM_INSTALL_PATH//${HOME}/\~}"
rm -rf "$ASDF_NIM_INSTALL_PATH"
cp -R "$ASDF_DOWNLOAD_PATH" "$ASDF_NIM_INSTALL_PATH"
step_end ""
step_end "\u2713"

# Finalize installation
step_start "mv to ${ASDF_INSTALL_PATH//${HOME}/\~}"
rm -rf "$ASDF_INSTALL_PATH"
mv -v "$ASDF_NIM_INSTALL_PATH" "$ASDF_INSTALL_PATH"
step_end ""
step_end "\u2713"

step_start "👑 installed Nim ${ASDF_INSTALL_VERSION}$(asdf_nim_time)"
step_end ""
step_start "\U1F451 installed Nim ${ASDF_INSTALL_VERSION}$(asdf_nim_time)"
step_end "\u2713"

if [ "$ASDF_NIM_DEBUG" = "yes" ]; then
set +x
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"
services:
asdf:
build:
Expand Down
52 changes: 26 additions & 26 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ asdf_nim_on_exit() {
if [ -d "$ASDF_INSTALL_PATH" ]; then
step_start "rm ${ASDF_INSTALL_PATH//${HOME}/\~}"
rm -rf "$ASDF_INSTALL_PATH"
step_end ""
step_end "\u2713"
fi
}

Expand All @@ -98,7 +98,7 @@ asdf_nim_on_exit() {
# Force delete
step_start "rm ${ASDF_DOWNLOAD_PATH//${HOME}/\~}"
rm -rf "$ASDF_DOWNLOAD_PATH"
step_end ""
step_end "\u2713"
else
# asdf will delete this folder depending on --keep-download or
# always_keep_download flag, so respect that by not deleting here;
Expand All @@ -107,7 +107,7 @@ asdf_nim_on_exit() {
# can be deleted if asdf decides to delete.
step_start "chmod ${ASDF_DOWNLOAD_PATH//${HOME}/\~}"
chmod -R 700 "$ASDF_DOWNLOAD_PATH"
step_end ""
step_end "\u2713"
fi
fi
}
Expand All @@ -117,10 +117,10 @@ asdf_nim_on_exit() {
if [ "$ASDF_NIM_REMOVE_TEMP" = "yes" ]; then
step_start "rm ${ASDF_NIM_TEMP//${HOME}/\~}"
rm -rf "$ASDF_NIM_TEMP"
step_end ""
step_end "\u2713"
else
step_start "ASDF_NIM_REMOVE_TEMP=${ASDF_NIM_REMOVE_TEMP}, keeping temp dir ${ASDF_NIM_TEMP//${HOME}/\~}"
step_end ""
step_end "\u2713"
fi
fi
}
Expand Down Expand Up @@ -497,14 +497,14 @@ asdf_nim_download_via_git() {
rm -rf "$ASDF_NIM_DOWNLOAD_PATH"
mkdir -p "$ASDF_NIM_DOWNLOAD_PATH"
(
cd "$ASDF_NIM_DOWNLOAD_PATH"
cd "$ASDF_NIM_DOWNLOAD_PATH" || exit
git init
git remote add origin "$SOURCE_REPO"
git fetch origin "$ASDF_INSTALL_VERSION" --depth 1
git reset --hard FETCH_HEAD
chmod -R 700 . # For asdf cleanup
)
step_end ""
step_end "\u2713"
}

asdf_nim_download_via_url() {
Expand All @@ -521,7 +521,7 @@ asdf_nim_download_via_url() {
step_start "curl ${url}"
archive_path="$(asdf_nim_fetch "$url")"
if [ -n "$archive_path" ]; then
step_end ""
step_end "\u2713"
break
else
if [ "$((i + 1))" -ge "${#urls[@]}" ]; then
Expand All @@ -547,7 +547,7 @@ asdf_nim_download_via_url() {
rm -vr "$ASDF_NIM_DOWNLOAD_PATH/nim-${ASDF_INSTALL_VERSION}"
;;
esac
step_end ""
step_end "\u2713"
}

# Detect which method to install Nim with (official binary, nightly binary, or
Expand All @@ -559,7 +559,7 @@ asdf_nim_download() {

if [ -f "${ASDF_DOWNLOAD_PATH}/install.sh" ] || [ -f "${ASDF_DOWNLOAD_PATH}/build.sh" ] || [ -f "${ASDF_DOWNLOAD_PATH}/build_all.sh" ]; then
step_start "already downloaded"
step_end ""
step_end "\u2713"
return 0
fi

Expand Down Expand Up @@ -587,7 +587,7 @@ asdf_nim_download() {
rm -rf "$ASDF_DOWNLOAD_PATH"
mkdir -p "$(dirname "$ASDF_DOWNLOAD_PATH")"
mv -v "$ASDF_NIM_DOWNLOAD_PATH" "$ASDF_DOWNLOAD_PATH"
step_end ""
step_end "\u2713"

if [ "$ASDF_NIM_DEBUG" = "yes" ]; then
set +x
Expand Down Expand Up @@ -629,7 +629,7 @@ asdf_nim_fetch() {
}

asdf_nim_bootstrap_nim() {
cd "$ASDF_DOWNLOAD_PATH"
cd "$ASDF_DOWNLOAD_PATH" || exit

local nim
nim="./bin/nim"
Expand All @@ -638,19 +638,19 @@ asdf_nim_bootstrap_nim() {
# source directory has build.sh to build koch, nim, and tools.
step_start "./build.sh"
sh build.sh
step_end ""
step_end "\u2713"
elif [ -f "build_all.sh" ]; then
# source directory has build_all.sh to build koch, nim, and tools.
step_start "./build_all.sh"
sh build_all.sh
step_end ""
step_end "\u2713"
else
step_start "nim already built"
step_end ""
step_end "\u2713"
fi
else
step_start "nim already built"
step_end ""
step_end "\u2713"
fi

[ -f "$nim" ] # A nim executable must exist at this point to proceed
Expand All @@ -662,41 +662,41 @@ asdf_nim_build_koch() {
local nim
nim="$1"
step_start "build koch"
cd "$ASDF_DOWNLOAD_PATH"
cd "$ASDF_DOWNLOAD_PATH" || exit
# shellcheck disable=SC2046
eval "$nim" c --skipParentCfg:on $(printf ' %q ' "${NIM_ARGS[@]}") koch
step_end ""
step_end "\u2713"
}

asdf_nim_build_nim() {
step_start "build nim"
cd "$ASDF_DOWNLOAD_PATH"
cd "$ASDF_DOWNLOAD_PATH" || exit
# shellcheck disable=SC2046
eval ./koch boot $(printf ' %q ' "${NIM_ARGS[@]}")
step_end ""
step_end "\u2713"
}

asdf_nim_build_tools() {
step_start "build tools"
cd "$ASDF_DOWNLOAD_PATH"
cd "$ASDF_DOWNLOAD_PATH" || exit
# shellcheck disable=SC2046
eval ./koch tools $(printf ' %q ' "${NIM_ARGS[@]}")
step_end ""
step_end "\u2713"
}

asdf_nim_build_nimble() {
step_start "build nimble"
cd "$ASDF_DOWNLOAD_PATH"
cd "$ASDF_DOWNLOAD_PATH" || exit
# shellcheck disable=SC2046
eval ./koch nimble $(printf ' %q ' "${NIM_ARGS[@]}")
step_end ""
step_end "\u2713"
}

# Build Nim binaries in ASDF_NIM_DOWNLOAD_PATH.
asdf_nim_build() {
section_start "II. Build (${ASDF_DOWNLOAD_PATH//${HOME}/\~})"

cd "$ASDF_DOWNLOAD_PATH"
cd "$ASDF_DOWNLOAD_PATH" || exit
local bootstrap
bootstrap=n
local build_tools
Expand All @@ -709,7 +709,7 @@ asdf_nim_build() {

if [ "$bootstrap" = "n" ] && [ "$build_tools" = "n" ] && [ "$build_nimble" = "n" ]; then
step_start "already built"
step_end ""
step_end "\u2713"
return 0
fi

Expand Down

0 comments on commit cb2d0c7

Please sign in to comment.