fix: WASM tests (#3415)

This commit is contained in:
Micha Reiser 2023-03-09 11:27:59 +01:00 committed by GitHub
parent 229f1c34cb
commit bd05a8a74d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,7 @@ use wasm_bindgen::prelude::*;
use ruff::directives; use ruff::directives;
use ruff::linter::{check_path, LinterResult}; use ruff::linter::{check_path, LinterResult};
use ruff::registry::AsRule;
use ruff::rules::{ use ruff::rules::{
flake8_annotations, flake8_bandit, flake8_bugbear, flake8_builtins, flake8_comprehensions, flake8_annotations, flake8_bandit, flake8_bugbear, flake8_builtins, flake8_comprehensions,
flake8_errmsg, flake8_implicit_str_concat, flake8_import_conventions, flake8_pytest_style, flake8_errmsg, flake8_implicit_str_concat, flake8_import_conventions, flake8_pytest_style,
@ -199,7 +200,7 @@ pub fn check(contents: &str, options: JsValue) -> Result<JsValue, JsValue> {
let messages: Vec<ExpandedMessage> = diagnostics let messages: Vec<ExpandedMessage> = diagnostics
.into_iter() .into_iter()
.map(|message| ExpandedMessage { .map(|message| ExpandedMessage {
code: message.kind.name, code: message.kind.rule().noqa_code().to_string(),
message: message.kind.body, message: message.kind.body,
location: message.location, location: message.location,
end_location: message.end_location, end_location: message.end_location,