Run Clippy on more configurations

pull/568/head
Tpt 1 year ago committed by Thomas Tanon
parent f6c8358b24
commit db7fab0f20
  1. 19
      .github/workflows/tests.yml
  2. 16
      lib/oxrdf/src/literal.rs
  3. 6
      python/src/lib.rs
  4. 2
      python/src/model.rs
  5. 12
      testsuite/src/files.rs

@ -42,7 +42,16 @@ jobs:
working-directory: ./lib/spargebra working-directory: ./lib/spargebra
- run: cargo clippy - run: cargo clippy
working-directory: ./lib/sparopt working-directory: ./lib/sparopt
- run: cargo clippy
working-directory: ./lib
- run: cargo clippy --all-targets --all-features - run: cargo clippy --all-targets --all-features
working-directory: ./lib
- run: cargo clippy
working-directory: ./python
- run: cargo clippy
working-directory: ./server
- run: cargo clippy
working-directory: ./testsuite
clippy_wasm_js: clippy_wasm_js:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -88,8 +97,16 @@ jobs:
working-directory: ./lib/spargebra working-directory: ./lib/spargebra
- run: cargo clippy -- -D warnings -D clippy::all - run: cargo clippy -- -D warnings -D clippy::all
working-directory: ./lib/sparopt working-directory: ./lib/sparopt
- run: cargo clippy --all-targets -- -D warnings -D clippy::all - run: cargo clippy -- -D warnings -D clippy::all
working-directory: ./lib
- run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::all
working-directory: ./lib
- run: cargo clippy -- -D warnings -D clippy::all
working-directory: ./python
- run: cargo clippy -- -D warnings -D clippy::all
working-directory: ./server working-directory: ./server
- run: cargo clippy -- -D warnings -D clippy::all
working-directory: ./testsuite
clippy_msv_wasm_js: clippy_msv_wasm_js:
runs-on: ubuntu-latest runs-on: ubuntu-latest

@ -673,35 +673,35 @@ mod tests {
fn test_canoincal_escaping() { fn test_canoincal_escaping() {
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000a\u000b\u000c\u000d\u000e\u000f""#).unwrap().to_string(), Literal::from_str(r#""\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000a\u000b\u000c\u000d\u000e\u000f""#).unwrap().to_string(),
r###""\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000B\f\r\u000E\u000F""### r#""\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000B\f\r\u000E\u000F""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f""#).unwrap().to_string(), Literal::from_str(r#""\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f""#).unwrap().to_string(),
r###""\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F""### r#""\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0020\u0021\u0022\u0023\u0024\u0025\u0026\u0027\u0028\u0029\u002a\u002b\u002c\u002d\u002e\u002f""#).unwrap().to_string(), Literal::from_str(r#""\u0020\u0021\u0022\u0023\u0024\u0025\u0026\u0027\u0028\u0029\u002a\u002b\u002c\u002d\u002e\u002f""#).unwrap().to_string(),
r###"" !\"#$%&'()*+,-./""### r##"" !\"#$%&'()*+,-./""##
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037\u0038\u0039\u003a\u003b\u003c\u003d\u003e\u003f""#).unwrap().to_string(), Literal::from_str(r#""\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037\u0038\u0039\u003a\u003b\u003c\u003d\u003e\u003f""#).unwrap().to_string(),
r###""0123456789:;<=>?""### r#""0123456789:;<=>?""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004a\u004b\u004c\u004d\u004e\u004f""#).unwrap().to_string(), Literal::from_str(r#""\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004a\u004b\u004c\u004d\u004e\u004f""#).unwrap().to_string(),
r###""@ABCDEFGHIJKLMNO""### r#""@ABCDEFGHIJKLMNO""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005a\u005b\u005c\u005d\u005e\u005f""#).unwrap().to_string(), Literal::from_str(r#""\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005a\u005b\u005c\u005d\u005e\u005f""#).unwrap().to_string(),
r###""PQRSTUVWXYZ[\\]^_""### r#""PQRSTUVWXYZ[\\]^_""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006a\u006b\u006c\u006d\u006e\u006f""#).unwrap().to_string(), Literal::from_str(r#""\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006a\u006b\u006c\u006d\u006e\u006f""#).unwrap().to_string(),
r###""`abcdefghijklmno""### r#""`abcdefghijklmno""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007a\u007b\u007c\u007d\u007e\u007f""#).unwrap().to_string(), Literal::from_str(r#""\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007a\u007b\u007c\u007d\u007e\u007f""#).unwrap().to_string(),
r###""pqrstuvwxyz{|}~\u007F""### r#""pqrstuvwxyz{|}~\u007F""#
); );
assert_eq!( assert_eq!(
Literal::from_str(r#""\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008a\u008b\u008c\u008d\u008e\u008f""#).unwrap().to_string(), Literal::from_str(r#""\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008a\u008b\u008c\u008d\u008e\u008f""#).unwrap().to_string(),

@ -1,3 +1,9 @@
#![allow(
clippy::used_underscore_binding,
clippy::unused_self,
clippy::trivially_copy_pass_by_ref
)]
mod io; mod io;
mod model; mod model;
mod sparql; mod sparql;

@ -426,7 +426,7 @@ impl PyLiteral {
/// The RDF `default graph name <https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph>`_. /// The RDF `default graph name <https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph>`_.
#[pyclass(frozen, name = "DefaultGraph", module = "pyoxigraph")] #[pyclass(frozen, name = "DefaultGraph", module = "pyoxigraph")]
#[derive(Eq, PartialEq, Debug, Clone, Copy, Hash)] #[derive(Eq, PartialEq, Debug, Clone, Copy, Hash)]
pub struct PyDefaultGraph {} pub struct PyDefaultGraph;
impl From<PyDefaultGraph> for GraphName { impl From<PyDefaultGraph> for GraphName {
fn from(_: PyDefaultGraph) -> Self { fn from(_: PyDefaultGraph) -> Self {

@ -47,9 +47,7 @@ pub fn load_to_graph(
graph.insert(&t); graph.insert(&t);
} }
Err(e) => { Err(e) => {
if ignore_errors { if !ignore_errors {
continue;
} else {
return Err(e.into()); return Err(e.into());
} }
} }
@ -83,9 +81,7 @@ pub fn load_to_dataset(
dataset.insert(&q); dataset.insert(&q);
} }
Err(e) => { Err(e) => {
if ignore_errors { if !ignore_errors {
continue;
} else {
return Err(e.into()); return Err(e.into());
} }
} }
@ -116,9 +112,7 @@ pub fn load_n3(url: &str, ignore_errors: bool) -> Result<Vec<N3Quad>> {
match q { match q {
Ok(q) => quads.push(q), Ok(q) => quads.push(q),
Err(e) => { Err(e) => {
if ignore_errors { if !ignore_errors {
continue;
} else {
return Err(e.into()); return Err(e.into());
} }
} }

Loading…
Cancel
Save