Created by: ackintosh
Related issue: https://github.com/OpenAPITools/openapi-generator/issues/5417
Add error output to the log so that we can make sure why the error occured, when the command passed via RUBY_POST_PROCESS_FILE failed.
PR checklist
-
Read the contribution guidelines. -
If contributing template-only or documentation-only changes which will change sample output, build the project before. -
Run the shell script(s) under ./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc). -
File the PR against the correct branch: master
,4.3.x
,5.0.x
. Default:master
. -
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
# Rubocop
$ which rubocop
/usr/local/bin/rubocop
$ rubocop -v
0.80.0
# Generate ruby client with a RUBY_POST_PROCESS_FILE environment variable
$ env RUBY_POST_PROCESS_FILE="/usr/local/bin/rubocop -a" \
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar \
generate \
-g ruby \
-o /tmp/issue/5417 \
-i http://petstore.swagger.io:8080/api/v3/openapi.json \
--enable-post-process-file
Before:
[main] ERROR o.o.c.languages.AbstractRubyCodegen - Error running the command (/usr/local/bin/rubocop -a /tmp/issue/5417/lib/openapi_client/models/address.rb). Exit value: 2
After: the error output shows why rubocop resulted in error
[main] ERROR o.o.c.languages.AbstractRubyCodegen - Error running the command (/usr/local/bin/rubocop -a /tmp/issue/5417/lib/openapi_client/api_client.rb). Exit value: 2, Error output: Error: The `Layout/IndentFirstArgument` cop has been renamed to `Layout/FirstArgumentIndentation`.(obsolete configuration found in /tmp/issue/5417/.rubocop.yml, please update it)The `Layout/TrailingBlankLines` cop has been renamed to `Layout/TrailingEmptyLines`.(obsolete configuration found in /tmp/issue/5417/.rubocop.yml, please update it)The `Style/UnneededPercentQ` cop has been renamed to `Style/RedundantPercentQ`.(obsolete configuration found in /tmp/issue/5417/.rubocop.yml, please update it)The `Style/BracesAroundHashParameters` cop has been removed.(obsolete configuration found in /tmp/issue/5417/.rubocop.yml, please update it)obsolete `EnforcedStyle: rails` (for Layout/IndentationConsistency) found in /tmp/issue/5417/.rubocop.yml`EnforcedStyle: rails` has been renamed to `EnforcedStyle: indented_internal_methods`