Skip to content

Commit 4d7601e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into wordwrap
2 parents eed3967 + 79eb752 commit 4d7601e

36 files changed

+642
-238
lines changed

.cargo/config.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --package xtask --"

.github/mkdocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ nav:
66
- Introduction: 'index.md'
77
- User Guide: 'userguide.md'
88
- Contributing:
9-
- Contributing Guide: 'contribute.md'
9+
- Contributing Guide: 'contributing.md'
1010
- Roadmap: 'roadmap.md'
1111
- Documentation:
1212
- Known Issues: 'KnownIssues.md'
@@ -86,4 +86,4 @@ plugins:
8686
minify_html: true
8787
htmlmin_opts:
8888
remove_comments: true
89-
cache_safe: true
89+
cache_safe: true

.github/workflows/github-pages.yml

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ jobs:
2020
with:
2121
fetch-depth: '0' # Fetch all commit history for all branches as well as tags.
2222

23+
- name: Copy Contributing Guidelines
24+
run: |
25+
echo "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
26+
27+
- uses: stefanzweifel/git-auto-commit-action@v5
28+
with:
29+
commit_message: Commit Contributing Guidelines
30+
file_pattern: "docs/contributing.md"
31+
add_options: '--force'
32+
if: success()
33+
2334
- name: Setup Python
2435
uses: actions/setup-python@v5
2536
with:

.github/workflows/linutil.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,23 @@ jobs:
8989
version: ${{ env.version }}
9090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9191

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

99-
- name: Build the preview
101+
- name: Move preview
100102
run: |
101-
export PATH="$(pwd)/build:$PATH"
102-
vhs docs/assets/preview.tape -o docs/assets/preview.gif
103+
mv preview.gif docs/assets/preview.gif
103104
104-
- name: Upload the preview
105+
- name: Upload preview
105106
uses: stefanzweifel/git-auto-commit-action@v5
106107
with:
107108
commit_message: Preview for ${{ env.version }}
108109
file_pattern: "docs/assets/preview.gif"
109110
add_options: "--force"
110-
if: success()
111+
if: success()

.github/workflows/shellcheck.yml

+35-10
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,42 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- run: git fetch origin ${{ github.base_ref }}
1616

17-
- name: Download and set up shellcheck
17+
- name: Download, setup, and run ShellCheck
18+
shell: bash {0}
1819
run : |
19-
wget https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz
20-
tar -xf shellcheck-v0.10.0.linux.x86_64.tar.xz
21-
cd shellcheck-v0.10.0
22-
chmod +x shellcheck
23-
24-
- name: Run shellcheck
25-
run: |
26-
for file in $(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs); do
20+
SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz"
21+
curl -fsSL "$SC_URL" | tar -Jx
22+
chmod +x "./shellcheck-v0.10.0/shellcheck"
23+
24+
error=0
25+
files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs)
26+
27+
for file in $files_to_check; do
2728
if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then
28-
./shellcheck-v0.10.0/shellcheck -S error "$file"
29+
sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file")
30+
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')
31+
32+
for error in $iter_safe_parsed_errors; do
33+
echo "$error" | sed 's/:space:/ /g'
34+
error=1
35+
done
36+
37+
tabs_detected=$(grep -nP '^\t+\S+' "$file")
38+
39+
# fast fail on the action runner would fail immediately if there weren't any tabs found
40+
# this check makes sure that we don't continue if there's something really weird going on
41+
if [ "$?" = "2" ]; then
42+
echo "::error file=$file::There was a critical error while grepping $file, aborting"
43+
exit 1
44+
fi
45+
46+
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')
47+
48+
for error in $iter_safe_parsed_tabs_detected; do
49+
echo "$error" | sed 's/:space:/ /g'
50+
error=1
51+
done
2952
fi
3053
done
54+
55+
exit $error

.github/workflows/typos.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Check for typos
2+
3+
on:
4+
[push, pull_request, workflow_dispatch]
5+
6+
jobs:
7+
check-typos:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- run: git fetch origin ${{ github.base_ref }}
13+
14+
- name: Run spellcheck
15+
uses: crate-ci/[email protected]

.github/workflows/xtask.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: XTasks
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "xtask"
7+
- "Cargo.toml"
8+
- "Cargo.lock"
9+
- ".cargo"
10+
- "core/tabs"
11+
- "docs"
12+
push:
13+
paths:
14+
- "xtask"
15+
- "Cargo.toml"
16+
- "Cargo.lock"
17+
- ".cargo"
18+
- "core/tabs"
19+
- "docs"
20+
21+
env:
22+
CARGO_TERM_COLOR: always
23+
24+
jobs:
25+
docgen:
26+
name: DocGen
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout sources
31+
uses: actions/checkout@v4
32+
33+
- name: Install Rust
34+
uses: dtolnay/rust-toolchain@stable
35+
36+
- name: Cache Cargo registry
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cargo/registry
40+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
41+
restore-keys: ${{ runner.os }}-cargo-registry-
42+
43+
- name: Cache Cargo index
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/.cargo/git
47+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
48+
restore-keys: ${{ runner.os }}-cargo-index-
49+
50+
- name: Run cargo xtask docgen
51+
run: cargo xtask docgen
52+
53+
- name: Check uncommitted documentation changes
54+
run: |
55+
git diff
56+
git diff-files --quiet \
57+
|| (echo "Run 'cargo xtask docgen' and push the changes" \
58+
&& exit 1)

Cargo.lock

+29-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[workspace.package]
22
license = "MIT"
33
version = "24.9.28"
4+
edition = "2021"
45

56
[workspace.dependencies]
67
ego-tree = "0.6.2"
78

89
[workspace]
9-
members = ["tui", "core"]
10+
members = ["tui", "core", "xtask"]
11+
default-members = ["tui", "core"]
1012
resolver = "2"
1113

1214
[patch.crates-io]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ makepkg -si
4949

5050
Replace `<package>` with your preferred package.
5151

52-
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:
52+
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:
5353

5454
```bash
5555
paru -S linutil

_typos.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[files]
2+
extend-exclude = ["tui/cool_tips.txt"]
3+
4+
[default]
5+
extend-ignore-identifiers-re = [
6+
"ratatui",
7+
]

0 commit comments

Comments
 (0)