Skip to content

Commit 4fc6b64

Browse files
committed
Fix CI
1 parent 66a23be commit 4fc6b64

File tree

9 files changed

+39
-36
lines changed

9 files changed

+39
-36
lines changed

.travis.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,27 @@ script:
1414
- (cd wundergraph_derive && cargo check --no-default-features --features "$BACKEND")
1515
- (cd wundergraph && cargo check --no-default-features --features "$BACKEND extras")
1616
- (cd wundergraph_example && cargo check --no-default-features --features "$BACKEND" )
17-
- (cd wundergraph_bench && cargo check --no-default-features)
18-
- (cd wundergraph_cli && cargo check --no-default-features --features "$BACKEND")
17+
- (cd wundergraph_bench && cargo check --no-default-features --features "$BACKEND")
18+
# - (cd wundergraph_cli && cargo check --no-default-features --features "$BACKEND")
1919
matrix:
2020
allow_failures:
2121
- rust: nightly
2222
include:
23-
- rust: nightly-2018-06-15
23+
- rust: nightly-2019-10-03
2424
env: CLIPPY=YESPLEASE
2525
script:
26-
- (cd wundergraph_derive && cargo check --no-default-features --features "lint postgres sqlite")
27-
- (cd wundergraph && cargo check --no-default-features --features "lint postgres sqlite extras")
28-
- (cd wundergraph_example && cargo check --no-default-features --features "lint sqlite")
29-
- (cd wundergraph_example && cargo check --no-default-features --features "lint postgres")
30-
- (cd wundergraph_bench && cargo check --no-default-features --features "lint")
31-
- (cd wundergraph_cli && cargo check --no-default-features --features "lint postgres sqlite")
32-
- rust: nightly-2018-06-15
26+
- rustup component add clippy
27+
- (cd wundergraph_derive && cargo clippy --no-default-features --features "postgres sqlite")
28+
- (cd wundergraph && cargo clippy --no-default-features --features "lint postgres sqlite extras")
29+
- (cd wundergraph_example && cargo clippy --no-default-features --features "sqlite")
30+
- (cd wundergraph_example && cargo clippy --no-default-features --features "postgres")
31+
- (cd wundergraph_bench && cargo clippy --no-default-features --features "postgres" )
32+
- (cd wundergraph_bench && cargo clippy --no-default-features --features "sqlite" )
33+
- (cd wundergraph_cli && cargo clippy --no-default-features --features "postgres sqlite")
34+
- rust: nightly-2019-10-03
3335
env: RUSTFMT=YESPLEASE
3436
script:
35-
- rustup component add rustfmt-preview
37+
- rustup component add rustfmt
3638
- cargo fmt --all -- --check
3739

3840
env:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ members = [
88
]
99

1010
[patch.crates-io]
11-
wundergraph_derive = { path = "wundergraph_derive"}
11+
#wundergraph_derive = { path = "wundergraph_derive"}

wundergraph/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ serde = "1"
1616
diesel = { version = "1.4", features = ["r2d2"]}
1717
juniper = "0.14"
1818
indexmap = "1"
19-
wundergraph_derive = "0.1"
19+
wundergraph_derive = { path = "../wundergraph_derive" }
2020
uuid_internal = { version = "0.7", optional = true, package = "uuid" }
2121
chrono_internal = { version = "0.4", optional = true, package = "chrono" }
2222
log = { version = "0.4", optional = true }
2323
paste = "0.1"
2424
thiserror = "1"
2525

2626
[dev-dependencies]
27-
#wundergraph_example = { path = "../wundergraph_example", default-features = false }
28-
#wundergraph_bench = { path = "../wundergraph_bench", default-features = false }
27+
wundergraph_example = { path = "../wundergraph_example", default-features = false }
28+
wundergraph_bench = { path = "../wundergraph_bench", default-features = false }
2929
diesel_migrations = "1.4.0"
3030
serde_json = "1"
3131
criterion = "0.3"

wundergraph/src/helper/primary_keys.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl NamedTable
221221
.to_string()
222222
.split("--")
223223
.next()
224-
.unwrap()
224+
.expect("It's there otherwise diesel changed the debug output")
225225
.replace("\"", "")
226226
.replace(".", "_"),
227227
)
@@ -248,8 +248,9 @@ where
248248
}
249249
}
250250

251-
fn uppercase_first_letter<'a>(s: Cow<'a, str>) -> Cow<'a, str> {
252-
if s.chars().next().map(|c| c.is_uppercase()).unwrap_or(true) {
251+
#[allow(clippy::needless_pass_by_value)]
252+
fn uppercase_first_letter(s: Cow<'_, str>) -> Cow<'_, str> {
253+
if s.chars().next().map_or(true, |c| c.is_uppercase()) {
253254
Cow::Owned(s.trim().to_string())
254255
} else {
255256
Cow::Owned(

wundergraph/src/third_party_integrations/chrono.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ impl Nameable for NaiveDate {
3434
}
3535
}
3636

37-
static RFC3339_PARSE_FORMAT: &'static str = "%+";
38-
static RFC3339_FORMAT: &'static str = "%Y-%m-%dT%H:%M:%S%.f%:z";
37+
static RFC3339_PARSE_FORMAT: &str = "%+";
38+
static RFC3339_FORMAT: &str = "%Y-%m-%dT%H:%M:%S%.f%:z";
3939

4040
impl FromLookAheadValue for NaiveDateTime {
4141
fn from_look_ahead(v: &LookAheadValue<'_, WundergraphScalarValue>) -> Option<Self> {

wundergraph_bench/src/bin/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![deny(missing_debug_implementations, missing_copy_implementations)]
22
#![warn(
3-
clippy::option_unwrap_used,
4-
clippy::result_unwrap_used,
53
clippy::print_stdout,
64
clippy::wrong_pub_self_convention,
75
clippy::mut_mut,
@@ -19,7 +17,6 @@
1917
clippy::map_flatten,
2018
clippy::match_same_arms,
2119
clippy::needless_borrow,
22-
clippy::needless_pass_by_value,
2320
clippy::option_map_unwrap_or,
2421
clippy::option_map_unwrap_or_else,
2522
clippy::redundant_clone,

wundergraph_bench/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![deny(missing_debug_implementations, missing_copy_implementations)]
22
#![warn(
3-
clippy::option_unwrap_used,
4-
clippy::result_unwrap_used,
53
clippy::print_stdout,
64
clippy::wrong_pub_self_convention,
75
clippy::mut_mut,
@@ -19,7 +17,6 @@
1917
clippy::map_flatten,
2018
clippy::match_same_arms,
2119
clippy::needless_borrow,
22-
clippy::needless_pass_by_value,
2320
clippy::option_map_unwrap_or,
2421
clippy::option_map_unwrap_or_else,
2522
clippy::redundant_clone,

wundergraph_derive/src/belonging_to.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn derive_belonging_to(
4848
.map(|(parent_ty, (key_ty, f))| {
4949
let pg = if cfg!(feature = "postgres") {
5050
Some(derive_belongs_to(
51-
&model,
51+
model,
5252
item,
5353
parent_ty,
5454
&key_ty,
@@ -60,7 +60,7 @@ pub fn derive_belonging_to(
6060
};
6161
let sqlite = if cfg!(feature = "sqlite") {
6262
Some(derive_belongs_to(
63-
&model,
63+
model,
6464
item,
6565
parent_ty,
6666
&key_ty,

wundergraph_derive/src/meta.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl MetaItem {
112112
self.span()
113113
.warning(format!(
114114
"The form `{0}(value)` is deprecated. Use `{0} = \"value\"` instead",
115-
self.name().get_ident().unwrap(),
115+
self.name().get_ident().expect("Failed to get ident"),
116116
))
117117
.emit();
118118
Ok(x)
@@ -132,7 +132,7 @@ impl MetaItem {
132132
let meta = &self.meta;
133133
Err(self.span().error(format!(
134134
"Expected `{}` found `{}`",
135-
self.name().get_ident().unwrap(),
135+
self.name().get_ident().expect("Failed to get ident"),
136136
quote!(#meta)
137137
)))
138138
}
@@ -145,7 +145,7 @@ impl MetaItem {
145145
List(ref list) => Ok(Nested(list.nested.iter())),
146146
_ => Err(self.span().error(format!(
147147
"`{0}` must be in the form `{0}(...)`",
148-
self.name().get_ident().unwrap()
148+
self.name().get_ident().expect("Failed to get ident")
149149
))),
150150
}
151151
}
@@ -165,7 +165,7 @@ impl MetaItem {
165165
Str(ref s) => Ok(s),
166166
_ => Err(self.span().error(format!(
167167
"`{0}` must be in the form `{0} = \"value\"`",
168-
self.name().get_ident().unwrap()
168+
self.name().get_ident().expect("Failed to get ident")
169169
))),
170170
}
171171
}
@@ -177,7 +177,7 @@ impl MetaItem {
177177
NameValue(ref name_value) => Ok(&name_value.lit),
178178
_ => Err(self.span().error(format!(
179179
"`{0}` must be in the form `{0} = \"value\"`",
180-
self.name().get_ident().unwrap()
180+
self.name().get_ident().expect("Failed to get ident")
181181
))),
182182
}
183183
}
@@ -188,14 +188,20 @@ impl MetaItem {
188188
Ok(x) => x,
189189
Err(_) => return,
190190
};
191-
let unrecognized_options = nested
192-
.filter(|n| !options.contains(&(&n.name().get_ident().unwrap().to_string() as _)));
191+
let unrecognized_options = nested.filter(|n| {
192+
!options.contains(
193+
&(&n.name()
194+
.get_ident()
195+
.expect("Failed to get ident")
196+
.to_string() as _),
197+
)
198+
});
193199
for ignored in unrecognized_options {
194200
ignored
195201
.span()
196202
.warning(format!(
197203
"Option {} has no effect",
198-
ignored.name().get_ident().unwrap()
204+
ignored.name().get_ident().expect("Failed to get ident")
199205
))
200206
.emit();
201207
}

0 commit comments

Comments
 (0)