Increase max line length for generated client code (#2835)

This PR increases the max line length on generated client code to reduce
the likelihood of rustfmt failing to format files.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This commit is contained in:
John DiSanti 2023-07-10 11:36:15 -07:00 committed by GitHub
parent 3a133b1807
commit 705f0f0700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -170,7 +170,8 @@ class ClientCodegenVisitor(
),
)
try {
"cargo fmt".runCommand(fileManifest.baseDir, timeout = settings.codegenConfig.formatTimeoutSeconds.toLong())
// use an increased max_width to make rustfmt fail less frequently
"cargo fmt -- --config max_width=150".runCommand(fileManifest.baseDir, timeout = settings.codegenConfig.formatTimeoutSeconds.toLong())
} catch (err: CommandFailed) {
logger.warning("Failed to run cargo fmt: [${service.id}]\n${err.output}")
}