Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into package-managers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 9, 2024
2 parents b9f69ba + 79eb752 commit 80fda67
Show file tree
Hide file tree
Showing 36 changed files with 629 additions and 232 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
4 changes: 2 additions & 2 deletions .github/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav:
- Introduction: 'index.md'
- User Guide: 'userguide.md'
- Contributing:
- Contributing Guide: 'contribute.md'
- Contributing Guide: 'contributing.md'
- Roadmap: 'roadmap.md'
- Documentation:
- Known Issues: 'KnownIssues.md'
Expand Down Expand Up @@ -86,4 +86,4 @@ plugins:
minify_html: true
htmlmin_opts:
remove_comments: true
cache_safe: true
cache_safe: true
11 changes: 11 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
with:
fetch-depth: '0' # Fetch all commit history for all branches as well as tags.

- name: Copy Contributing Guidelines
run: |
echo "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit Contributing Guidelines
file_pattern: "docs/contributing.md"
add_options: '--force'
if: success()

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/linutil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,23 @@ jobs:
version: ${{ env.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install vhs
- name: Setup Preview
run: |
wget 'https://github.com/charmbracelet/vhs/releases/download/v0.8.0/vhs_0.8.0_amd64.deb'
sudo apt install -y ffmpeg
sudo snap install ttyd --classic
sudo dpkg -i 'vhs_0.8.0_amd64.deb'
echo "$(pwd)/build" >> $GITHUB_PATH
- name: Generate preview
uses: charmbracelet/[email protected]
with:
path: "docs/assets/preview.tape"

- name: Build the preview
- name: Move preview
run: |
export PATH="$(pwd)/build:$PATH"
vhs docs/assets/preview.tape -o docs/assets/preview.gif
mv preview.gif docs/assets/preview.gif
- name: Upload the preview
- name: Upload preview
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Preview for ${{ env.version }}
file_pattern: "docs/assets/preview.gif"
add_options: "--force"
if: success()
if: success()
45 changes: 35 additions & 10 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,42 @@ jobs:
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }}

- name: Download and set up shellcheck
- name: Download, setup, and run ShellCheck
shell: bash {0}
run : |
wget https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz
tar -xf shellcheck-v0.10.0.linux.x86_64.tar.xz
cd shellcheck-v0.10.0
chmod +x shellcheck
- name: Run shellcheck
run: |
for file in $(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs); do
SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz"
curl -fsSL "$SC_URL" | tar -Jx
chmod +x "./shellcheck-v0.10.0/shellcheck"
error=0
files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs)
for file in $files_to_check; do
if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then
./shellcheck-v0.10.0/shellcheck -S error "$file"
sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file")
iter_safe_parsed_errors=$(echo -e "$sc_output" | sed -n 's/\(.\+\)\:\([0-9]\+\)\:\([0-9]\+\)\: \(.*\)/::error file=\1,line=\2,col=\3::\4/p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_errors; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
tabs_detected=$(grep -nP '^\t+\S+' "$file")
# fast fail on the action runner would fail immediately if there weren't any tabs found
# this check makes sure that we don't continue if there's something really weird going on
if [ "$?" = "2" ]; then
echo "::error file=$file::There was a critical error while grepping $file, aborting"
exit 1
fi
iter_safe_parsed_tabs_detected=$(echo "$tabs_detected" | sed -n 's,\([0-9]\+\).*,::error file='"$file"'\,line=\1::Found tab indentations,p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_tabs_detected; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
fi
done
exit $error
15 changes: 15 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Check for typos

on:
[push, pull_request, workflow_dispatch]

jobs:
check-typos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }}

- name: Run spellcheck
uses: crate-ci/[email protected]
58 changes: 58 additions & 0 deletions .github/workflows/xtask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: XTasks

on:
pull_request:
paths:
- "xtask"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo"
- "core/tabs"
- "docs"
push:
paths:
- "xtask"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo"
- "core/tabs"
- "docs"

env:
CARGO_TERM_COLOR: always

jobs:
docgen:
name: DocGen
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-registry-

- name: Cache Cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-index-

- name: Run cargo xtask docgen
run: cargo xtask docgen

- name: Check uncommitted documentation changes
run: |
git diff
git diff-files --quiet \
|| (echo "Run 'cargo xtask docgen' and push the changes" \
&& exit 1)
43 changes: 29 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[workspace.package]
license = "MIT"
version = "24.9.28"
edition = "2021"

[workspace.dependencies]
ego-tree = "0.6.2"

[workspace]
members = ["tui", "core"]
members = ["tui", "core", "xtask"]
default-members = ["tui", "core"]
resolver = "2"

[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ makepkg -si

Replace `<package>` with your preferred package.

If you use [yay](https://github.com/Jguer/yay), [paru](https://github.com/Morganamilo/paru) or any other [AUR Helper](https://wiki.archlinux.org/title/AUR_helpers), it's even simplier:
If you use [yay](https://github.com/Jguer/yay), [paru](https://github.com/Morganamilo/paru) or any other [AUR Helper](https://wiki.archlinux.org/title/AUR_helpers), it's even simpler:

```bash
paru -S linutil
Expand Down
7 changes: 7 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[files]
extend-exclude = ["tui/cool_tips.txt"]

[default]
extend-ignore-identifiers-re = [
"ratatui",
]
Loading

0 comments on commit 80fda67

Please sign in to comment.