Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing whitespace from comments #3922

Open
LinusU opened this issue Apr 24, 2020 · 0 comments
Open

Remove trailing whitespace from comments #3922

LinusU opened this issue Apr 24, 2020 · 0 comments
Labels
core Related to codegen core/cli kind/enhancement New feature or request plugins

Comments

@LinusU
Copy link

LinusU commented Apr 24, 2020

Describe the bug

A recent version of the code generator started adding comments to the fields, this is great!

However, if the comment contained a blank line, the generator will add a single space at the end of that line. This is probably because every line is indented by a single space.

This leads to the following warnings when adding the file with git:

<stdin>:201: trailing whitespace.
   * 
<stdin>:221: trailing whitespace.
   * 
<stdin>:224: trailing whitespace.
   * 
warning: 3 lines add whitespace errors.

To Reproduce
Steps to reproduce the behavior:

  1. My GraphQL schema:
type Foo {
    """
    This is the first line of the documentation, it will be followed by an empty line.

    Here is the last line, there is an empty line in between.
    """
    bar: String
}
  1. My GraphQL operations:
n/a
  1. My codegen.yml config file:
overwrite: true
schema: http://localhost:4000/graphql
generates:
  src/types.ts:
    plugins:
      - "typescript"

Expected behavior

I expected there to not be a trailing space on those lines.

Environment:

  • OS: macOS 10.15.4
  • @graphql-codegen/...:
    "@graphql-codegen/cli": "^1.13.3",
    "@graphql-codegen/typescript": "^1.13.3",
    "@graphql-codegen/typescript-resolvers": "^1.13.3",
  • NodeJS: v12.12.0

Additional context
n/a

@dotansimha dotansimha added kind/enhancement New feature or request and removed enhancement labels Jun 20, 2021
@charlypoly charlypoly added the core Related to codegen core/cli label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to codegen core/cli kind/enhancement New feature or request plugins
Projects
None yet
Development

No branches or pull requests

3 participants