Skip to content

Conversation

@RitoG09
Copy link

@RitoG09 RitoG09 commented Dec 31, 2025

Fixes #140

What have been done

  1. The Sourcemeta Studio webview now renders lint diagnostics sorted by source location.
  2. e2e test cases written for linting order (lint-order.schema.json).

Proof of Action

image

@jviotti
Copy link
Member

jviotti commented Dec 31, 2025

The diff is huge, as it seems you are changing formatting/indention of the entire files you touch. Can you configure your editor to follow the current conventions so that the diff only reflects the actual changes?

The industry standard out there is EditorConfig (https://editorconfig.org), which you should be able to install on your editor. That will make it follow https://github.com/sourcemeta/studio/blob/main/.editorconfig

@jviotti
Copy link
Member

jviotti commented Dec 31, 2025

I'm also wondering if we can actually do the ordering on the CLI when lint --json is used? Then it will cascade here. And here we can keep the tests? If you are up to, feel free to open a PR for the CLI too

@RitoG09
Copy link
Author

RitoG09 commented Dec 31, 2025

I have formatted it using editorconfig in my latest commit, can u check it once?

@RitoG09
Copy link
Author

RitoG09 commented Jan 1, 2026

I'm also wondering if we can actually do the ordering on the CLI when lint --json is used? Then it will cascade here. And here we can keep the tests? If you are up to, feel free to open a PR for the CLI too

@jviotti will work on it and open a PR after 3-4 days as my semester end exams are going on.

});

test("Lint diagnostics should be ordered by line number", async function () {
this.timeout(15000);
Copy link
Member

Choose a reason for hiding this comment

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

Indentation problems here?

Copy link
Author

Choose a reason for hiding this comment

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

fixed it.


if (lintResult.errors && lintResult.errors.length > 0) {
// TODO: Consider moving lint diagnostic ordering to the jsonschema CLI
lintResult.errors = sortLintErrorsByLocation(lintResult.errors);
Copy link
Member

Choose a reason for hiding this comment

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

Indentation issues here?

Copy link
Author

Choose a reason for hiding this comment

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

fixed it.

@RitoG09
Copy link
Author

RitoG09 commented Jan 5, 2026

@jviotti , the ordering is already implemented on CLI by @Karan-Palan . I think we should remove the todo comment.

@Karan-Palan
Copy link
Collaborator

@jviotti , the ordering is already implemented on CLI by @Karan-Palan . I think we should remove the todo comment.

We might not need to merge this if ordering works fine on the CLI

@RitoG09
Copy link
Author

RitoG09 commented Jan 6, 2026

@jviotti , the ordering is already implemented on CLI by @Karan-Palan . I think we should remove the todo comment.

We might not need to merge this if ordering works fine on the CLI

yeah, it makes sense.

@jviotti
Copy link
Member

jviotti commented Jan 6, 2026

Let's merge the CLI PR first. I think we still want this PR, mostly because of the test.

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.

Order lint diagnostics by source location in the Studio webview

3 participants