forked from mozilla/code-review
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bot: Support mozlint diffs, fixes mozilla#31
- Loading branch information
Bastien Abadie
committed
Feb 18, 2020
1 parent
737af4e
commit 0845149
Showing
3 changed files
with
381 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
{ | ||
"/build/checkout/": [ | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/", | ||
"message": "Reformat rust", | ||
"lineno": 0, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "Warning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.\nWarning: can't set `match_block_trailing_comma = true`, unstable features are only available in nightly channel.", | ||
"relpath": "." | ||
} | ||
], | ||
"/build/checkout/tools/fuzzing/rust/src/lib.rs": [ | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 16, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " use tempfile::Builder;\n\n fn eat_lmdb_err<T>(value: Result<T, rkv::StoreError>) -> Result<Option<T>, rkv::StoreError> {\n- // Should trigger rustfmt in patch\n- match value {\n+ // Should trigger rustfmt in patch\n+ match value {\n Ok(value) => Ok(Some(value)),\n Err(rkv::StoreError::LmdbError(_)) => Ok(None),\n Err(err) => {", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 24, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " println!(\"Not a crash, but an error outside LMDB: {}\", err);\n println!(\"A refined fuzzing test, or changes to RKV, might be required.\");\n Err(err)\n- },\n+ }\n }\n }", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 44, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "\n let &mut builder = rkv::Rkv::environment_builder().set_max_dbs(2);\n let env = rkv::Rkv::from_env(Path::new(\".\"), builder).unwrap();\n- let store = env.open_single(\"test\", rkv::StoreOptions::create()).unwrap();\n+ let store = env\n+ .open_single(\"test\", rkv::StoreOptions::create())\n+ .unwrap();\n\n let reader = env.read().unwrap();\n eat_lmdb_err(store.get(&reader, &[0])).unwrap();", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 78, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " pub extern \"C\" fn fuzz_rkv_key_write(raw_data: *const u8, size: libc::size_t) -> libc::c_int {\n let data = unsafe { std::slice::from_raw_parts(raw_data as *const u8, size as usize) };\n\n- let root = Builder::new().prefix(\"fuzz_rkv_key_write\").tempdir().unwrap();\n+ let root = Builder::new()\n+ .prefix(\"fuzz_rkv_key_write\")\n+ .tempdir()\n+ .unwrap();\n fs::create_dir_all(root.path()).unwrap();\n\n let env = rkv::Rkv::new(root.path()).unwrap();", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 85, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "- let store = env.open_single(\"test\", rkv::StoreOptions::create()).unwrap();\n+ let store = env\n+ .open_single(\"test\", rkv::StoreOptions::create())\n+ .unwrap();\n\n let mut writer = env.write().unwrap();\n // Some data are invalid values, and are handled as store errors.", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 96, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " pub extern \"C\" fn fuzz_rkv_val_write(raw_data: *const u8, size: libc::size_t) -> libc::c_int {\n let data = unsafe { std::slice::from_raw_parts(raw_data as *const u8, size as usize) };\n\n- let root = Builder::new().prefix(\"fuzz_rkv_val_write\").tempdir().unwrap();\n+ let root = Builder::new()\n+ .prefix(\"fuzz_rkv_val_write\")\n+ .tempdir()\n+ .unwrap();\n fs::create_dir_all(root.path()).unwrap();\n\n let env = rkv::Rkv::new(root.path()).unwrap();", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 103, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "- let store = env.open_single(\"test\", rkv::StoreOptions::create()).unwrap();\n+ let store = env\n+ .open_single(\"test\", rkv::StoreOptions::create())\n+ .unwrap();\n\n let mut writer = env.write().unwrap();\n let string = String::from_utf8_lossy(data);", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 129, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "\n #[no_mangle]\n pub extern \"C\" fn fuzz_rkv_calls(raw_data: *const u8, size: libc::size_t) -> libc::c_int {\n- let mut fuzz = unsafe { std::slice::from_raw_parts(raw_data as *const u8, size as usize).to_vec() };\n+ let mut fuzz =\n+ unsafe { std::slice::from_raw_parts(raw_data as *const u8, size as usize).to_vec() };\n\n fn maybe_do(fuzz: &mut Vec<u8>, f: impl FnOnce(&mut Vec<u8>) -> ()) -> Option<()> {\n match fuzz.pop().map(|byte| byte % 2) {", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 136, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " Some(0) => Some(f(fuzz)),\n- _ => None\n+ _ => None,\n }\n }", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 141, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "- fn maybe_abort(fuzz: &mut Vec<u8>, read: rkv::Reader) -> Result<(), rkv::StoreError> {\n+ fn maybe_abort(fuzz: &mut Vec<u8>, read: rkv::Reader) -> Result<(), rkv::StoreError> {\n match fuzz.pop().map(|byte| byte % 2) {\n Some(0) => Ok(read.abort()),\n- _ => Ok(())\n+ _ => Ok(()),\n }\n };", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 148, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "- fn maybe_commit(fuzz: &mut Vec<u8>, write: rkv::Writer) -> Result<(), rkv::StoreError> {\n+ fn maybe_commit(fuzz: &mut Vec<u8>, write: rkv::Writer) -> Result<(), rkv::StoreError> {\n match fuzz.pop().map(|byte| byte % 3) {\n Some(0) => write.commit(),\n Some(1) => Ok(write.abort()),", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 152, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "- _ => Ok(())\n+ _ => Ok(()),\n }\n };", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 187, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " });\n\n let env = rkv::Rkv::from_env(root.path(), builder).unwrap();\n- let store = env.open_single(\"test\", rkv::StoreOptions::create()).unwrap();\n+ let store = env\n+ .open_single(\"test\", rkv::StoreOptions::create())\n+ .unwrap();\n\n loop {\n match fuzz.pop().map(|byte| byte % 4) {", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 194, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " Some(0) => {\n let key = match get_key(&mut fuzz) {\n Some(value) => value,\n- None => break\n+ None => break,\n };\n let value = match get_value(&mut fuzz) {\n Some(value) => value,", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 201, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": "- None => break\n+ None => break,\n };\n let mut writer = env.write().unwrap();\n eat_lmdb_err(store.put(&mut writer, key, &rkv::Value::Str(value))).unwrap();", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 207, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " Some(1) => {\n let key = match get_key(&mut fuzz) {\n Some(value) => value,\n- None => break\n+ None => break,\n };\n let mut reader = env.read().unwrap();\n eat_lmdb_err(store.get(&mut reader, key)).unwrap();", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 216, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " Some(2) => {\n let key = match get_key(&mut fuzz) {\n Some(value) => value,\n- None => break\n+ None => break,\n };\n let mut writer = env.write().unwrap();\n eat_lmdb_err(store.delete(&mut writer, key)).unwrap();", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
}, | ||
{ | ||
"linter": "rust", | ||
"path": "/build/checkout/tools/fuzzing/rust/src/lib.rs", | ||
"message": "Reformat rust", | ||
"lineno": 229, | ||
"column": null, | ||
"hint": null, | ||
"source": null, | ||
"level": "warning", | ||
"rule": null, | ||
"lineoffset": null, | ||
"diff": " let n = fuzz.pop().unwrap_or(1) as usize;\n builder.set_map_size(1_048_576 * (n % 100)); // 1,048,576 bytes, i.e. 1MiB.\n }\n- _ => {\n- break\n- }\n+ _ => break,\n }\n }\n\nWarning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.\nWarning: can't set `match_block_trailing_comma = true`, unstable features are only available in nightly channel.\nWarning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.\nWarning: can't set `match_block_trailing_comma = true`, unstable features are only available in nightly channel.\n", | ||
"relpath": "tools/fuzzing/rust/src/lib.rs" | ||
} | ||
] | ||
} |
Oops, something went wrong.