From 818055e18b2b02eed02162e9c8b113187e3680af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sat, 20 Jun 2026 18:26:53 +0900 Subject: [PATCH] Resolve lints --- .github/workflows/build.yml | 3 ++- book/src/generated/lang-support.md | 2 +- xtask/src/main.rs | 12 ++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 010a1a88..646e6c9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,7 +92,7 @@ jobs: RUSTDOCFLAGS: -D warnings docs: - name: Docs + name: Grammar Lint runs-on: ubuntu-latest if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule' steps: @@ -127,6 +127,7 @@ jobs: run: cargo xtask docgen - name: Check uncommitted documentation changes + if: always() run: | git diff git diff-files --quiet \ diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 5076db9c..20a18eb6 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -298,7 +298,7 @@ | tlaplus | ✓ | | | | | | | todotxt | ✓ | | | | | | | tolk | ✓ | | ✓ | | | | -| toml | ✓ | ✓ | | ✓ | ✓ | `taplo`, `tombi` | +| toml | ✓ | ✓ | ✓ | ✓ | ✓ | `taplo`, `tombi` | | tql | ✓ | | ✓ | | | | | tsq | ✓ | | | | ✓ | `ts_query_ls` | | tsx | ✓ | ✓ | ✓ | ✓ | ✓ | `typescript-language-server` | diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 01dff829..3a0ab177 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -442,7 +442,11 @@ pub mod tasks { .find(|(_, d)| d.config().language_id == lang) { Some((language, _)) => language, - None => return Err(format!("{}: no configured language '{lang}'", path.display()).into()), + None => { + return Err( + format!("{}: no configured language '{lang}'", path.display()).into(), + ) + } }; let source = std::fs::read_to_string(&path)?; let Some(sp) = spans(&loader, &scopes, language, &source) else { @@ -469,9 +473,9 @@ pub mod tasks { // An assertion line is a comment whose first `^` is preceded only // by the comment leader (no alphanumerics), so code like `a ^ b` // is never mistaken for one. - let marker = line.find('^').filter(|&c| { - !line[..c].bytes().any(|b| b.is_ascii_alphanumeric()) - }); + let marker = line + .find('^') + .filter(|&c| !line[..c].bytes().any(|b| b.is_ascii_alphanumeric())); let Some(col) = marker else { if !line.trim().is_empty() { base = Some(li); -- 2.51.2