Repository navigation
Fix the doc generation and remove uuhelp_parser #8610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,136 @@ | ||
| # spell-checker:ignore dtolnay libsystemd libattr libcap gsub | ||
|
|
||
| name: Check uudoc Documentation Generation | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'src/bin/uudoc.rs' | ||
| - 'src/uu/*/locales/en-US.ftl' | ||
| - 'Cargo.toml' | ||
| - '.github/workflows/documentation.yml' | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'src/bin/uudoc.rs' | ||
| - 'src/uu/*/locales/en-US.ftl' | ||
| - 'Cargo.toml' | ||
|
|
||
| jobs: | ||
| check-doc: | ||
| name: Verify uudoc generates correct documentation | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install/setup prerequisites | ||
| shell: bash | ||
| run: sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev libsystemd-dev libacl1-dev libattr1-dev libcap-dev | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Download tldr | ||
| run: curl https://tldr.sh/assets/tldr.zip -o docs/tldr.zip | ||
|
|
||
| - name: Generate documentation | ||
| run: cargo run --bin uudoc --all-features | ||
|
|
||
| - name: Get current version from Cargo.toml | ||
| id: version | ||
| run: | | ||
| VERSION=$(awk '/\[workspace\.package\]/{flag=1; next} flag && /version = /{gsub(/.*= "/, ""); gsub(/".*/, ""); print; exit}' Cargo.toml) | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "Detected version: $VERSION" | ||
|
|
||
| - name: Check for --repeated option in uniq.md | ||
| run: | | ||
| if [ ! -f "docs/src/utils/uniq.md" ]; then | ||
| echo "docs/src/utils/uniq.md does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -q -- "--repeated" docs/src/utils/uniq.md; then | ||
| echo "'--repeated' option not found in docs/src/utils/uniq.md" | ||
| echo "Content of uniq.md:" | ||
| head -50 docs/src/utils/uniq.md | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Check for correct version in ls.md | ||
| run: | | ||
| VERSION="${{ steps.version.outputs.version }}" | ||
|
|
||
| if [ ! -f "docs/src/utils/ls.md" ]; then | ||
| echo "docs/src/utils/ls.md does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -q "v(uutils coreutils) $VERSION" docs/src/utils/ls.md; then | ||
| echo "Version '$VERSION' not found in docs/src/utils/ls.md" | ||
| echo "Found version info:" | ||
| grep "v(uutils coreutils)" docs/src/utils/ls.md || echo "No version info found" | ||
| echo "Full version section:" | ||
| grep -A2 -B2 "version" docs/src/utils/ls.md || echo "No version section found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Verify usage information is present | ||
| run: | | ||
| if [ ! -f "docs/src/utils/cat.md" ]; then | ||
| echo "docs/src/utils/cat.md does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -q "cat \[OPTION\].*\[FILE\]" docs/src/utils/cat.md; then | ||
| echo "Usage information missing from cat.md" | ||
| echo "Content around usage:" | ||
| grep -A5 -B5 "cat" docs/src/utils/cat.md | head -20 | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Verify help text is properly resolved | ||
| run: | | ||
| if [ ! -f "docs/src/utils/cat.md" ]; then | ||
| echo "docs/src/utils/cat.md does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if grep -q "cat-help-" docs/src/utils/cat.md; then | ||
| echo "Found unresolved Fluent keys in cat.md - help text not properly translated" | ||
| echo "Unresolved Fluent keys found:" | ||
| grep "cat-help-" docs/src/utils/cat.md | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Verify about text is present | ||
| run: | | ||
| if [ ! -f "docs/src/utils/cat.md" ]; then | ||
| echo "docs/src/utils/cat.md does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -q "Concatenate FILE(s)" docs/src/utils/cat.md; then | ||
| echo "About text missing from cat.md" | ||
| echo "Content of cat.md:" | ||
| head -30 docs/src/utils/cat.md | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Verify tldr examples integration | ||
| run: | | ||
| if [ ! -f "docs/src/utils/cp.md" ]; then | ||
| echo "docs/src/utils/cp.md does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -q "The examples are provided by" docs/src/utils/cp.md; then | ||
| echo "tldr examples integration missing from cp.md" | ||
| echo "Expected to find 'The examples are provided by' text" | ||
| echo "Content of cp.md:" | ||
| tail -20 docs/src/utils/cp.md | ||
| exit 1 | ||
| fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.