-
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.
fix: deal with version >= 0.26.0 (#6)
* refactor: use new scripts * fix: update for v0.26.x * fixup * fixup * fixup * chore: cleanup files * chore: cleanup editorconfig config * test: add more bats tests
- Loading branch information
Showing
14 changed files
with
431 additions
and
254 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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
trim_trailing_whitespace = true | ||
|
||
# 4 space indentation | ||
# don't check for max_line_length, rely on pylint | ||
[*.py] | ||
indent_style = space | ||
indent_size = 4 | ||
max_line_length = unset | ||
|
||
[Makefile] | ||
indent_style = tab | ||
max_line_length = unset | ||
|
||
[*.mk] | ||
indent_style = tab | ||
max_line_length = unset | ||
|
||
[setup.cfg] | ||
indent_style = tab | ||
|
||
[*.{tf,tfvars}] | ||
indent_size = 2 | ||
indent_style = space | ||
max_line_length = unset | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
indent_style = space | ||
max_line_length = unset | ||
|
||
# Fix for json files | ||
[*.json] | ||
max_line_length = unset | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
max_line_length = unset | ||
indent_size = unset | ||
|
||
[*.sh] | ||
max_line_length = unset | ||
|
||
[LICENSE] | ||
max_line_length = unset | ||
indent_style = unset | ||
indent_size = unset | ||
|
||
[*.txt] | ||
max_line_length = unset | ||
|
||
[*.js] | ||
max_line_length = unset | ||
|
||
[*.{bats,bash}] | ||
max_line_length = unset |
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,14 +1,18 @@ | ||
--- | ||
name: AllInOne | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
branches: | ||
- master | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
schedule: | ||
- cron: 0 0 * * 5 | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }}-checks | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
plugin_test: | ||
|
@@ -20,34 +24,30 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: asdf_plugin_test | ||
uses: asdf-vm/actions/plugin-test@v1 | ||
uses: asdf-vm/actions/plugin-test@v3 | ||
with: | ||
command: gitui --version | ||
|
||
lint_and_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run the sh-checker | ||
uses: luizm/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
#SHELLCHECK_OPTS: -e SC1004 # Optional: exclude some shellcheck warnings. | ||
SHFMT_OPTS: -i 2 # Optional: pass arguments to shfmt. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Tools with asdf | ||
uses: asdf-vm/actions/install@v3 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
sh_checker_comment: true | ||
- name: Install asdf | ||
run: | | ||
git clone https://github.com/asdf-vm/asdf.git $HOME/asdf | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Install bats | ||
- name: Run pre-commit checks | ||
shell: bash | ||
run: | | ||
sudo apt-get install bats | ||
bats --version | ||
pre-commit run --all-files | ||
- name: Test plugin with bats | ||
run: | | ||
. $HOME/asdf/asdf.sh | ||
asdf plugin-add gitui $GITHUB_WORKSPACE | ||
bats test |
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 @@ | ||
.vscode/ |
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,8 @@ | ||
--- | ||
globs: | ||
- '**/*.md' | ||
- '!.venv*/**/*.md' | ||
- '!**/.tox/**/*.md' | ||
- '!**/.pytest_cache' | ||
- '!shared/bats-libs/**/*.md' | ||
- '!.github/actions/*/node_modules/**/*.md' |
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,20 @@ | ||
--- | ||
# For a list of all rules, see here: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md | ||
|
||
# Default state for all rules | ||
default: true | ||
|
||
# MD013/line-length - Line length | ||
MD013: false | ||
|
||
# MD024/Multiple headings with the same content | ||
MD024: false | ||
|
||
# MD026/no-trailing-punctuation - Trailing punctuation in heading | ||
MD026: false | ||
|
||
# MD033/no-inline-html - Inline HTML | ||
MD033: false | ||
|
||
# MD037/Spaces inside emphasis markers | ||
MD037: false |
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,45 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace # Trims trailing whitespace | ||
exclude: ^shared/bats-libs/.* | ||
- id: check-yaml # Validates YAML files | ||
args: | ||
- --allow-multiple-documents | ||
- id: check-json # Validates JSON files | ||
- id: check-toml # Validates TOML files | ||
- id: check-xml # Validates XML files | ||
- id: check-added-large-files # Checks for files that are added to the repository that are larger than a threshold | ||
- id: check-case-conflict # Checks for files that would conflict in case-insensitive filesystems | ||
- id: check-merge-conflict # Checks for files that contain merge conflict strings | ||
- id: detect-private-key # Check for the existence of private keys | ||
- id: check-executables-have-shebangs # Checks that executables have shebangs | ||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python | ||
rev: 2.6.1 | ||
hooks: | ||
- id: editorconfig-checker-system # Check editorconfig compliance | ||
alias: ec | ||
- repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
rev: 3.0.0 | ||
hooks: | ||
- id: shellcheck # Shell scripts conform to shellcheck | ||
- id: shfmt # Check shell style with shfmt | ||
|
||
- repo: https://github.com/DavidAnson/markdownlint-cli2 | ||
rev: v0.12.1 | ||
hooks: | ||
- id: markdownlint-cli2 | ||
|
||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
- id: yamllint | ||
args: [--config-data, relaxed, --no-warnings] | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '150', --explicit_start] |
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,5 @@ | ||
editorconfig-checker 2.6.0 | ||
shfmt 3.8.0 | ||
shellcheck 0.10.0 | ||
bats 1.10.0 | ||
pre-commit 3.6.2 |
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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
current_script_path=${BASH_SOURCE[0]} | ||
plugin_dir=$(dirname "$(dirname "$current_script_path")") | ||
|
||
# shellcheck source=./lib/utils.bash | ||
source "${plugin_dir}/lib/utils.bash" | ||
|
||
mkdir -p "$ASDF_DOWNLOAD_PATH" | ||
|
||
# TODO: Adapt this to proper extension and adapt extracting strategy. | ||
release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION$(get_ext)" | ||
|
||
# Download tar.gz file to the download directory | ||
download_release "$ASDF_INSTALL_VERSION" "$release_file" | ||
|
||
# Extract contents of tar.gz file into the download directory | ||
tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" || fail "Could not extract $release_file" | ||
|
||
# Remove the tar.gz file since we don't need to keep it | ||
rm "$release_file" |
Oops, something went wrong.