Skip to content

Commit e79e30c

Browse files
authored
Merge pull request #415 from autarch/autarch/no-warnings
2 parents 58ed885 + bf58330 commit e79e30c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
- The `variables_derives` now trims whitespace from individual derivation traits.
1111
- The new `reqwest-rustls` feature works like the `reqwest` feature but with
1212
`rustls` rather than `native-tls`.
13+
- Code generated by the `graphql-client` CLI program now suppresses all
14+
warnings from rustc and clippy.
1315

1416
## 0.10.0 - 2021-07-04
1517

graphql_client_cli/src/generate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ pub(crate) struct CliCodegenParams {
2424
pub fragments_other_variant: bool,
2525
}
2626

27+
const WARNING_SUPPRESSION: &str = "#![allow(clippy::all, warnings)]";
28+
2729
pub(crate) fn generate_code(params: CliCodegenParams) -> CliResult<()> {
2830
let CliCodegenParams {
2931
variables_derives,
@@ -78,7 +80,7 @@ pub(crate) fn generate_code(params: CliCodegenParams) -> CliResult<()> {
7880
let gen = generate_module_token_stream(query_path.clone(), &schema_path, options)
7981
.map_err(|err| Error::message(format!("Error generating module code: {}", err)))?;
8082

81-
let generated_code = gen.to_string();
83+
let generated_code = format!("{}\n{}", WARNING_SUPPRESSION, gen);
8284
let generated_code = if !no_formatting {
8385
format(&generated_code)?
8486
} else {

0 commit comments

Comments
 (0)