Skip to content

Commit

Permalink
fix: make pre-commit pass against all files
Browse files Browse the repository at this point in the history
  • Loading branch information
shakefu committed Nov 18, 2023
1 parent b84f054 commit 3cf4eed
Show file tree
Hide file tree
Showing 79 changed files with 1,082 additions and 1,187 deletions.
111 changes: 2 additions & 109 deletions .bin/vim
Original file line number Diff line number Diff line change
@@ -1,111 +1,4 @@
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
# First, check "All the Usual Suspects" for the location of the Vim.app bundle.
# You can short-circuit this by setting the VIM_APP_DIR environment variable
# or by un-commenting and editing the following line:
VIM_APP_DIR=/usr/local/Cellar/macvim/7.4-96

if [ -z "$VIM_APP_DIR" ]
then
myDir="`dirname "$0"`"
myAppDir="$myDir/../Applications"
suspects=(
/Applications
~/Applications
/Applications/vim
~/Applications/vim
$myDir
$myDir/vim
$myAppDir
$myAppDir/vim
/Applications/Utilities
/Applications/Utilities/vim
)
for i in ${suspects[@]}; do
if [ -x "$i/MacVim.app" ]; then
VIM_APP_DIR="$i"
break
fi
done
fi
if [ -z "$VIM_APP_DIR" ]
then
echo "Sorry, cannot find MacVim.app. Try setting the VIM_APP_DIR environment variable to the directory containing MacVim.app."
exit 1
fi
binary="$VIM_APP_DIR/MacVim.app/Contents/MacOS/Vim"

# Next, peek at the name used to invoke this script, and set options
# accordingly.

name="`basename "$0"`"
gui=
opts=
stdin=false
diffmode=false

# GUI mode, implies forking
case "$name" in m*|g*|rm*|rg*) gui=true ;; esac

# Always use GUI mode
gui=true

# Restricted mode
case "$name" in r*) opts="$opts -Z";; esac

# vimdiff, view, and ex mode
case "$name" in
*vimdiff)
opts="$opts -dO"
;;
*view)
opts="$opts -R"
;;
*ex)
opts="$opts -e"
;;
esac

# Preserve command line options lazily
while [ -n "$1" ]; do
case $1 in
-d) diffmode=true; shift;;
-?*) opts="$opts $1"; shift;;
-) stdin=true; break;;
*) echo "*"; break;;
esac
done

# Last step: fire up vim.
# The program should fork by default when started in GUI mode, but it does
# not; we work around this when this script is invoked as "gvim" or "rgview"
# etc., but not when it is invoked as "vim -g".
if [ "$gui" ]; then
# Note: this isn't perfect, because any error output goes to the
# terminal instead of the console log.
# But if you use open instead, you will need to fully qualify the
# path names for any filenames you specify, which is hard.

# Handle stdin
if $stdin; then
exec "$binary" -g $opts -
elif $diffmode; then
exec "$binary" -f -g -d $opts $*
elif $tabs && [[ `$binary --serverlist` = "VIM" ]]; then
#make macvim open stuff in the same window instead of new ones
exec "$binary" -g $opts --remote-tab-silent ${1:+"$@"} &
wait
else
exec "$binary" -g $opts ${1:+"$@"}
fi
else
exec "$binary" $opts ${1:+"$@"}
fi
echo "Vim is deprecated."
exit 1
162 changes: 82 additions & 80 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,92 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
// Home template
"name": "shakefu/home",
// Home template
"name": "shakefu/home",

// Home image
"image": "shakefu/home:1.7.0",
// Home image
"image": "shakefu/home:1.7.0",

// Mounting in the host docker socket for docker-in-docker
"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Mounting in the host docker socket for docker-in-docker
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],

// Needed to support non-root user
"overrideCommand": false,
// Needed to support non-root user
"overrideCommand": false,

// Configure extensions for pre-loading
"customizations": {
"vscode": {
"extensions": [
"4ops.terraform",
"aaron-bond.better-comments",
"bierner.markdown-preview-github-styles",
"DavidAnson.vscode-markdownlint",
"dbaeumer.jshint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"eg2.vscode-npm-script",
"esbenp.prettier-vscode",
"gerane.Theme-IRBlack",
"GitHub.codespaces",
"GitHub.copilot",
"GitHub.copilot-chat",
"GitHub.copilot-labs",
"GitHub.github-vscode-theme",
"GitHub.heygithub",
"GitHub.remotehub",
"github.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"golang.go",
"Gruntfuggly.todo-tree",
"hashicorp.terraform",
"jetmartin.bats",
"jmreicha.tender",
"joelalejandro.nrql-language",
"markis.code-coverage",
"mikestead.dotenv",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter-keymap",
"ms-vscode.anycode-c-sharp",
"ms-vscode.anycode-cpp",
"ms-vscode.anycode-go",
"ms-vscode.anycode-java",
"ms-vscode.anycode-php",
"ms-vscode.anycode-python",
"ms-vscode.anycode-rust",
"ms-vscode.anycode-typescript",
"ms-vscode.azure-repos",
"ms-vscode.remote-repositories",
"ms-vsliveshare.vsliveshare",
"Orta.vscode-jest",
"pamaron.pytest-runner",
"redhat.vscode-yaml",
"renxzen.google-colab-theme",
"samverschueren.final-newline",
"stevencl.addDocComments",
"stkb.rewrap",
"tamasfe.even-better-toml",
"timonwong.shellcheck",
"vivaxy.vscode-conventional-commits",
"vscode-icons-team.vscode-icons",
"windmilleng.vscode-go-autotest",
"zeshuaro.vscode-python-poetry"
]
}
},
// Configure extensions for pre-loading
"customizations": {
"vscode": {
"extensions": [
"4ops.terraform",
"aaron-bond.better-comments",
"bierner.markdown-preview-github-styles",
"DavidAnson.vscode-markdownlint",
"dbaeumer.jshint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"eg2.vscode-npm-script",
"esbenp.prettier-vscode",
"gerane.Theme-IRBlack",
"GitHub.codespaces",
"GitHub.copilot",
"GitHub.copilot-chat",
"GitHub.copilot-labs",
"GitHub.github-vscode-theme",
"GitHub.heygithub",
"GitHub.remotehub",
"github.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"golang.go",
"Gruntfuggly.todo-tree",
"hashicorp.terraform",
"jetmartin.bats",
"jmreicha.tender",
"joelalejandro.nrql-language",
"markis.code-coverage",
"mikestead.dotenv",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter-keymap",
"ms-vscode.anycode-c-sharp",
"ms-vscode.anycode-cpp",
"ms-vscode.anycode-go",
"ms-vscode.anycode-java",
"ms-vscode.anycode-php",
"ms-vscode.anycode-python",
"ms-vscode.anycode-rust",
"ms-vscode.anycode-typescript",
"ms-vscode.azure-repos",
"ms-vscode.remote-repositories",
"ms-vsliveshare.vsliveshare",
"Orta.vscode-jest",
"pamaron.pytest-runner",
"redhat.vscode-yaml",
"renxzen.google-colab-theme",
"samverschueren.final-newline",
"stevencl.addDocComments",
"stkb.rewrap",
"tamasfe.even-better-toml",
"timonwong.shellcheck",
"vivaxy.vscode-conventional-commits",
"vscode-icons-team.vscode-icons",
"windmilleng.vscode-go-autotest",
"zeshuaro.vscode-python-poetry"
]
}
},

// Explicitly set user to match container
// TODO: Decide if we want this to be shakefu instead?
"remoteUser": "vscode",
// Explicitly set user to match container
// TODO: Decide if we want this to be shakefu instead?
"remoteUser": "vscode",

// Used by docker-in-docker for host mounting filesystem
// ref: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/docker-from-docker#using-bind-mounts-when-working-with-docker-inside-the-container
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" }
// Used by docker-in-docker for host mounting filesystem
// ref: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/docker-from-docker#using-bind-mounts-when-working-with-docker-inside-the-container
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" }
}
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
with:
repo: hadolint/hadolint
extension-matching: disable
rename-to: hadolint
# Fucking shellcheck uses a .xz compression so nothing fucking works to
# extract it in GHA. Fuck you shellcheck
# - name: Install shellcheck
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/release-bin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
matrix:
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/386, darwin/amd64
goos:
- darwin
- linux
- darwin
- linux
# - windows
goarch:
- amd64
- arm64
- amd64
- arm64
# - arm
# - "386"
steps:
- uses: actions/checkout@v2
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GHA_TOKEN }}
goversion: https://golang.org/dl/go1.20.2.linux-amd64.tar.gz
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
- uses: actions/checkout@v2
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GHA_TOKEN }}
goversion: https://golang.org/dl/go1.20.2.linux-amd64.tar.gz
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ repos:
rev: 3.0.0
hooks:
- id: shellcheck
exclude: "^files/(.zshrc|.p10k.zsh)$"
# - id: shfmt
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
args:
[
--ignore,
DL3008,
--ignore,
DL3059,
--ignore,
SC3037,
--ignore,
DL4006,
]
- repo: https://github.com/golangci/golangci-lint
rev: v1.55.2
hooks:
Expand Down
15 changes: 11 additions & 4 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
{
"name": "(f|b|c)/*",
"channel": "next",
"prerelease":
"beta-${(/^[a-zA-Z]+-[0-9]+/.exec(name.substr(2)) || [name.replace(/[_/.]/g, '-')])[0]}-${Date.now()}"
"prerelease": "beta-${(/^[a-zA-Z]+-[0-9]+/.exec(name.substr(2)) || [name.replace(/[_/.]/g, '-')])[0]}-${Date.now()}"
}
],
"plugins": [
Expand All @@ -19,7 +18,11 @@
"types": [
{ "type": "build", "section": "Build System", "hidden": false },
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
{ "type": "ci", "section": "Continuous Integration", "hidden": false },
{
"type": "ci",
"section": "Continuous Integration",
"hidden": false
},
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
Expand All @@ -28,7 +31,11 @@
"section": "Performance Improvements",
"hidden": false
},
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
Expand Down
Loading

0 comments on commit 3cf4eed

Please sign in to comment.