Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jul 11, 2024
1 parent 2328d4d commit 334c859
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 299 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:

test:
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
name: Test
strategy:
fail-fast: false
Expand Down Expand Up @@ -76,6 +75,7 @@ jobs:
- run: cargo ck
- run: cargo test --no-run
- run: cargo test
- run: git diff --exit-code # Everything should be commited

test-windows:
needs: optimize_ci
Expand Down
14 changes: 8 additions & 6 deletions crates/oxc_linter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,20 @@ mod test {

#[test]
fn test_schema_json() {
use std::fs;

use project_root::get_project_root;
use std::fs;
let path = get_project_root().unwrap().join("npm/oxlint/configuration_schema.json");
let existing_json = fs::read_to_string(&path).unwrap_or_default();
let schema = schemars::schema_for!(OxlintConfig);
let json = serde_json::to_string_pretty(&schema).unwrap();
let existing_json = fs::read_to_string(&path).unwrap_or_default();
if existing_json != json {
std::fs::write(&path, &json).unwrap();
}
insta::with_settings!({ prepend_module_to_snapshot => false }, {
insta::assert_snapshot!(json);
});
let s = fs::read_to_string(&path).expect("file exits");
let json = serde_json::from_str::<serde_json::Value>(&s).expect("is json");
assert_eq!(
json.as_object().unwrap().get("title").unwrap().as_str().unwrap(),
"OxlintConfig"
);
}
}
288 changes: 0 additions & 288 deletions crates/oxc_linter/src/snapshots/schema_json.snap

This file was deleted.

4 changes: 0 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ clone-submodule dir url sha:
git clone --depth=1 {{url}} {{dir}} || true
cd {{dir}} && git fetch origin {{sha}} && git reset --hard {{sha}}

# Re-genenerate the JSON schema for oxlint's config.
linter-schema:
cargo run -p website -- linter-schema-json > npm/oxlint/configuration_schema.json

website path:
cargo run -p website -- linter-rules > {{path}}/src/docs/guide/usage/linter/generated-rules.md
cargo run -p website -- linter-cli > {{path}}/src/docs/guide/usage/linter/generated-cli.md
Expand Down

0 comments on commit 334c859

Please sign in to comment.