Skip to content

[BUG][R] generated git_push.sh fails shellcheck #10343

@ahjota

Description

@ahjota

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Generated R client includes a supporting file git_push.sh, that fails shellcheck.

✗ shellcheck samples/client/petstore/R/git_push.sh

In samples/client/petstore/R/git_push.sh line 41:
git_remote=`git remote`
           ^----------^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
git_remote=$(git remote)


In samples/client/petstore/R/git_push.sh line 48:
        git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
                                                     ^----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...

My organization lints shell scripts religiously throughout our codebase, so this came up really quickly in CI. I implemented a custom template to fix this internally, but this should really be fixed at the source.

openapi-generator version

Using 5.2.1, but issue exists in master.

OpenAPI declaration file content or url
Generation Details

Replicable with any valid specification.

Steps to reproduce
openapi-generator generate --config bin/configs/r-client.yaml
Related issues/PRs
Suggest a fix

#10345

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions