Skip to content

Commit

Permalink
feat: use trunk mega {formatt,lint}er
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
  • Loading branch information
vladdoster committed Feb 21, 2022
1 parent 5a32f3e commit c9f45dd
Show file tree
Hide file tree
Showing 30 changed files with 547 additions and 506 deletions.
4 changes: 1 addition & 3 deletions .cz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
name = "cz_conventional_commits"
tag_format = "v$version"
version = '1.5.0'
version_files = [
"VERSION"
]
version_files = ["VERSION"]
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Autoformatter friendly flake8 config (all formatting rules disabled)
[flake8]
extend-ignore = E1, E2, E3, E501, W1, W2, W3, W5
4 changes: 4 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Following source doesn't work in most setups
ignored:
- SC1090
- SC1091
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
10 changes: 10 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Autoformatter friendly markdownlint config (all formatting rules disabled)
default: true
blank_lines: false
bullet: false
html: false
indentation: false
line_length: false
spaces: false
url: false
whitespace: false
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- hooks:
- id: commitizen
stages:
- commit-msg
repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.4
- hooks:
- id: commitizen
stages:
- commit-msg
repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.4
7 changes: 7 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
enable=all
source-path=SCRIPTDIR
disable=SC2154

# If you're having issues with shellcheck following source, disable the errors via:
# disable=SC1090
# disable=SC1091
1 change: 1 addition & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*out
17 changes: 17 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 0.1
cli:
version: 0.7.0-beta
lint:
enabled:
- actionlint@1.6.4
- black-py@21.10b0
- flake8@3.9.2
- gitleaks@7.6.1
- hadolint@2.8.0
- isort@5.9.3
- markdownlint@0.29.0
- prettier@2.4.1
- shellcheck@0.7.2
- shfmt@3.4.0
- taplo@release-cli-0.5.0
- taplo-fmt@release-cli-0.5.0
30 changes: 11 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
# [1.5.0](https://github.com/vladdoster/dotfiles/compare/v1.4.2...v1.5.0) (2022-02-15)


### Bug Fixes

* clean up history env vars & try pip completion ([03fc305](https://github.com/vladdoster/dotfiles/commit/03fc3051bdd463660b3193004aea6b021501ebf9))
* clean up tmux config annoyances and visuals ([024b246](https://github.com/vladdoster/dotfiles/commit/024b24659530803e62aebbef69790f68a6268485))

- clean up history env vars & try pip completion ([03fc305](https://github.com/vladdoster/dotfiles/commit/03fc3051bdd463660b3193004aea6b021501ebf9))
- clean up tmux config annoyances and visuals ([024b246](https://github.com/vladdoster/dotfiles/commit/024b24659530803e62aebbef69790f68a6268485))

### Features

* add easy way to clone github repositories ([f03980e](https://github.com/vladdoster/dotfiles/commit/f03980ed4a3effe531902c1f4fc0bd4171d3c903))
* add graphviz and yasm ([c7b0644](https://github.com/vladdoster/dotfiles/commit/c7b0644f914228012ff0f1a07921ce983d0575fd))
- add easy way to clone github repositories ([f03980e](https://github.com/vladdoster/dotfiles/commit/f03980ed4a3effe531902c1f4fc0bd4171d3c903))
- add graphviz and yasm ([c7b0644](https://github.com/vladdoster/dotfiles/commit/c7b0644f914228012ff0f1a07921ce983d0575fd))

## [1.4.2](https://github.com/vladdoster/dotfiles/compare/v1.4.1...v1.4.2) (2022-02-12)


### Bug Fixes

* hammerspoon tiling & docker completions ([570b274](https://github.com/vladdoster/dotfiles/commit/570b274cc82795e71d56656e9b1a6bf2967868f7))
- hammerspoon tiling & docker completions ([570b274](https://github.com/vladdoster/dotfiles/commit/570b274cc82795e71d56656e9b1a6bf2967868f7))

## [1.4.1](https://github.com/vladdoster/dotfiles/compare/v1.4.0...v1.4.1) (2022-02-12)

# [1.4.0](https://github.com/vladdoster/dotfiles/compare/v1.3.5...v1.4.0) (2022-02-12)


### Features

* add get-gh-release.sh to download and install programs hosted on GitHub ([30576b2](https://github.com/vladdoster/dotfiles/commit/30576b277bddb6ef8350622046221b34b460fb74))
- add get-gh-release.sh to download and install programs hosted on GitHub ([30576b2](https://github.com/vladdoster/dotfiles/commit/30576b277bddb6ef8350622046221b34b460fb74))

## [1.3.5](https://github.com/vladdoster/dotfiles/compare/v1.3.4...v1.3.5) (2022-02-11)

Expand All @@ -36,30 +32,26 @@

## [1.3.2](https://github.com/vladdoster/dotfiles/compare/v1.3.1...v1.3.2) (2022-02-07)


### Bug Fixes

* nvim binary selection more precise ([4f29f6e](https://github.com/vladdoster/dotfiles/commit/4f29f6e0d18b886787e20f71f36a1974198dffff))
- nvim binary selection more precise ([4f29f6e](https://github.com/vladdoster/dotfiles/commit/4f29f6e0d18b886787e20f71f36a1974198dffff))

## [1.3.1](https://github.com/vladdoster/dotfiles/compare/v1.3.0...v1.3.1) (2022-02-06)


### Bug Fixes

* consistent order of files in replacement and change verification due to impl ([4ae6fac](https://github.com/vladdoster/dotfiles/commit/4ae6fac870255f8a0a736e42617ef131388ae296))
* update version in .cz.toml when version changes ([c4bb776](https://github.com/vladdoster/dotfiles/commit/c4bb776bbeb3025f395ca6f52bfb2d67887fd49d))
- consistent order of files in replacement and change verification due to impl ([4ae6fac](https://github.com/vladdoster/dotfiles/commit/4ae6fac870255f8a0a736e42617ef131388ae296))
- update version in .cz.toml when version changes ([c4bb776](https://github.com/vladdoster/dotfiles/commit/c4bb776bbeb3025f395ca6f52bfb2d67887fd49d))

# [1.3.0](https://github.com/vladdoster/dotfiles/compare/v1.2.0...v1.3.0) (2022-02-06)


### Bug Fixes

* correct version regex in semantic-release configuration ([81f5d93](https://github.com/vladdoster/dotfiles/commit/81f5d9327a02c8d86fb86dbf199105f23f84c95b))

- correct version regex in semantic-release configuration ([81f5d93](https://github.com/vladdoster/dotfiles/commit/81f5d9327a02c8d86fb86dbf199105f23f84c95b))

### Features

* add bash script to remove ALL local and remote tags from the current git dir ([ebecc00](https://github.com/vladdoster/dotfiles/commit/ebecc0067680abc58395330b235767ebb4c26b0a))
- add bash script to remove ALL local and remote tags from the current git dir ([ebecc00](https://github.com/vladdoster/dotfiles/commit/ebecc0067680abc58395330b235767ebb4c26b0a))

## v1.2.0 (2022-02-06)

Expand Down
10 changes: 5 additions & 5 deletions bash/.bashrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

function git_stashes_count {
st_num=$(/usr/bin/git stash list 2> /dev/null | wc -l | tr -d ' ')
if [[ $st_num != "0" ]]; then
echo "stashes($st_num) "
fi
st_num=$(/usr/bin/git stash list 2>/dev/null | wc -l | tr -d ' ')
if [[ $st_num != "0" ]]; then
echo "stashes($st_num) "
fi
}

function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/{\1}/'
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/{\1}/'
}

BLUE="\[\e[0;34m\]"
Expand Down
2 changes: 1 addition & 1 deletion bin/.local/bin/apple-silicon-m1-rosetta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
arch=$(/usr/bin/arch)

if [ "$arch" == "arm64" ]; then
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
fi
48 changes: 24 additions & 24 deletions bin/.local/bin/cherry-to-multiple-branchs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@
function log() { echo "--- $1"; }

function merge {
log "pulling any changes on branch"
git pull --rebase
log "cherry-picking commit: $1"
git cherry-pick -x "$1"
git status
log "pulling any changes on branch"
git pull --rebase
log "cherry-picking commit: $1"
git cherry-pick -x "$1"
git status

echo "Proceed with commit? (y/N):"
read XN
echo "Proceed with commit? (y/N):"
read XN

if [ "$XN" = "y" ]; then
log "committing"
git push origin
else
log "user aborted cherry-picking commit"
exit
fi
if [ "$XN" = "y" ]; then
log "committing"
git push origin
else
log "user aborted cherry-picking commit"
exit
fi
}

if [ ! -n "$1" ]; then
echo "Usage: cherrypick.sh <hash> [<branch1> <branch2> <branch3> ...]"
echo
echo "e.g. cherrypick.sh fb5cfe1cf2165abee 1.0.0 1.1.0 1.2.0"
exit
echo "Usage: cherrypick.sh <hash> [<branch1> <branch2> <branch3> ...]"
echo
echo "e.g. cherrypick.sh fb5cfe1cf2165abee 1.0.0 1.1.0 1.2.0"
exit
fi

if [ ! -n "$2" ]; then
log "cherry-picking to current branch"
merge "$1"
log "cherry-picking to current branch"
merge "$1"
else
for arg in "${@:2}"; do
git checkout "$arg"
merge "$1"
done
for arg in "${@:2}"; do
git checkout "$arg"
merge "$1"
done
fi
16 changes: 8 additions & 8 deletions bin/.local/bin/clang-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORK_DIR=$(mktemp -d)

if [[ ! $WORK_DIR || ! -d $WORK_DIR ]]; then
echo "--- failed creating temp build dir"
exit 1
echo "--- failed creating temp build dir"
exit 1
fi

function cleanup() {
sudo rm -rf "$WORK_DIR"
echo "--- cleaned up tmp build dir"
sudo rm -rf "$WORK_DIR"
echo "--- cleaned up tmp build dir"
}

# cleanup build artifacts on EXIT signals
Expand All @@ -24,21 +24,21 @@ trap cleanup EXIT
echo "--- entering build dir $PWD"
pushd "$WORK_DIR"
if git clone --depth=1 "$SRC_URL" "$PROGRAM"; then
echo "--- cloned $PROGRAM, continuing"
echo "--- cloned $PROGRAM, continuing"
fi
pushd "$PROGRAM"
mkdir build
pushd build
cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../llvm
echo "--- "
if autoreconf -iv; then
echo "--- autoreconf successfully, continuing"
echo "--- autoreconf successfully, continuing"
fi
if ./autogen.sh; then
echo "--- autogen.sh successful, continuing"
echo "--- autogen.sh successful, continuing"
fi
if ./configure; then
echo "--- configure successful, continuing"
echo "--- configure successful, continuing"
fi
echo "--- compiling $PROGRAM"
make -j
Expand Down
44 changes: 22 additions & 22 deletions bin/.local/bin/get-gh-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ echo "Downloading... $filename"
curl -s $url | jq -r --arg filename "$filename" '.assets[] | select(.name == $filename) | .browser_download_url' | wget -i- -q --show-progress -P "$tmp"

# extract
extract () {
for arg in $@ ; do
if [ -f $arg ] ; then
case $arg in
*.tar.bz2) tar xjf $arg ;;
*.tar.gz) tar xzf $arg ;;
*.tar.xz) tar xzf $arg ;;
*.bz2) bunzip2 $arg ;;
*.gz) gunzip $arg ;;
*.tar) tar xf $arg ;;
*.tbz2) tar xjf $arg ;;
*.tgz) tar xzf $arg ;;
*.zip) unzip $arg ;;
*.Z) uncompress $arg ;;
*.rar) rar x $arg ;; # 'rar' must to be installed
*.jar) jar -xvf $arg ;; # 'jdk' must to be installed
*) echo "'$arg' cannot be extracted via extract()" ;;
esac
else
echo "'$arg' is not a valid file"
fi
done
extract() {
for arg in $@; do
if [ -f $arg ]; then
case $arg in
*.tar.bz2) tar xjf $arg ;;
*.tar.gz) tar xzf $arg ;;
*.tar.xz) tar xzf $arg ;;
*.bz2) bunzip2 $arg ;;
*.gz) gunzip $arg ;;
*.tar) tar xf $arg ;;
*.tbz2) tar xjf $arg ;;
*.tgz) tar xzf $arg ;;
*.zip) unzip $arg ;;
*.Z) uncompress $arg ;;
*.rar) rar x $arg ;; # 'rar' must to be installed
*.jar) jar -xvf $arg ;; # 'jdk' must to be installed
*) echo "'$arg' cannot be extracted via extract()" ;;
esac
else
echo "'$arg' is not a valid file"
fi
done
}

pushd $tmp
Expand Down
Loading

0 comments on commit c9f45dd

Please sign in to comment.