Skip to content

feat: set up linting, lsp, and create new lint no_unknown_attributes lint#199

Merged
noahbald merged 9 commits intomainfrom
feat/no-unknown-attributes-lint
Nov 29, 2025
Merged

feat: set up linting, lsp, and create new lint no_unknown_attributes lint#199
noahbald merged 9 commits intomainfrom
feat/no-unknown-attributes-lint

Conversation

@noahbald
Copy link
Owner

@noahbald noahbald commented Nov 28, 2025

Description

This PR does three things

  1. Sets up oxvg_lint with a new rule no_unknown_attributes
  2. Adds a new oxvg lint check command to run lints on files
  3. Adds a new oxvg lint serve command to run a diagnostics lsp

Running oxvg lint check

image

Running oxvg lint serve from Helix

image

Motivation and Context

This sets up linting as one of the main tools of the oxvg toolchain

How Has This Been Tested?

  • Unit tests
  • Linting w3c
  • Adding as lsp to Helix

This can be used in helix with the following language configuration

[[language]]
name = "svg"
scope = "source.svg"
file-types = ["svg"]
grammar = "svg"
language-servers = ["oxvg"]
formatter = { command = "oxvg", args = ["format"] }
auto-format = true

[language-server.oxvg]
command = "oxvg"
args = ["lint", "serve"]

Types of changes

Fixes

  • Adds missing "y" to tref expected attributes
  • Format will exit with error code on error
  • Decouples directory walker from optimiser

Features

  • Set up linting runner in oxvg_lint
  • Created lint no_unknown_attributes
  • Set up oxvg lint check command
  • Set up oxvg lint serve command

Breaking changes

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@noahbald noahbald self-assigned this Nov 28, 2025
reports: RefCell<Vec<Error<'input>>>,
}

impl<'input, 'arena> Visitor<'input, 'arena> for Rules {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visitor may be overkill. Because linting is immutable, we could instead create a rayon::iter::ParalelIterator over a node's descendants.

@noahbald noahbald force-pushed the feat/no-unknown-attributes-lint branch from 2c85a52 to 0b71d56 Compare November 28, 2025 22:13
@noahbald noahbald force-pushed the feat/no-unknown-attributes-lint branch from 0b71d56 to d30d413 Compare November 28, 2025 23:52
@noahbald noahbald merged commit 6f0097c into main Nov 29, 2025
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant