Skip to content

fix(flutter-freezed): missing comma in enums #72

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

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

MitkoTschimev
Copy link
Contributor

@MitkoTschimev MitkoTschimev commented Jan 26, 2023

Add missing trailing comma for enum values

Before

enum AssetOrder {
  @JsonKey(name: 'contentType_ASC')
  contentTypeAsc
  @JsonKey(name: 'contentType_DESC')
  contentTypeDesc
}

Now

enum AssetOrder {
  @JsonKey(name: 'contentType_ASC')
  contentTypeAsc,
  @JsonKey(name: 'contentType_DESC')
  contentTypeDesc,
}

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Related # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Environment:

  • OS:
  • @graphql-codegen/...:
  • NodeJS:

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Add missing trailing comma for enum values

Before
```dart
enum AssetOrder {
  @jsonkey(name: 'contentType_ASC')
  contentTypeAsc
  @jsonkey(name: 'contentType_DESC')
  contentTypeDesc
}
```
Now
```dart
enum AssetOrder {
  @jsonkey(name: 'contentType_ASC')
  contentTypeAsc,
  @jsonkey(name: 'contentType_DESC')
  contentTypeDesc,
}
```
@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2023

🦋 Changeset detected

Latest commit: 9c972ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/flutter-freezed Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@saihaj
Copy link
Collaborator

saihaj commented Jan 27, 2023

@Parables can you check this out?

Copy link
Collaborator

@saihaj saihaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add a test for this

@Parables
Copy link
Contributor

@MitkoTschimev thanks for trying out this plugin and for the PR. I sincerely appreciate your contribution

To get your PR merged, please complete the following:

  • Run yarn && yarn test -u to Update the tests. This will update the tests/plugin.spec.ts from line 42 - 144

@Parables
Copy link
Contributor

we should add a test for this

@saihaj how can I do that on my end here and push it back into this PR?

@saihaj
Copy link
Collaborator

saihaj commented Jan 27, 2023

we should add a test for this

@saihaj how can I do that on my end here and push it back into this PR?

I think @MitkoTschimev can update tests?

@Parables
Copy link
Contributor

@MitkoTschimev thanks for trying out this plugin and for the PR. I sincerely appreciate your contribution

To get your PR merged, please complete the following:

  • Run yarn && yarn test -u to Update the tests. This will update the tests/plugin.spec.ts from line 42 - 144

@MitkoTschimev, please do this and let's get this fixed as soon as possible.
I don't mean to pressure you but this is a critical issue. It renders this plugin and its output totally useless

@MitkoTschimev
Copy link
Contributor Author

Let me take a look tomorrow to fix the tests

@Parables
Copy link
Contributor

Parables commented Feb 1, 2023

@MitkoTschimev, any updates on this?

If it's okay with you, I can fix this and tag you on the PR attributing the fix to you.

@MitkoTschimev
Copy link
Contributor Author

MitkoTschimev commented Feb 1, 2023

sorry for the late response :( was very busy at business!
I triggered an update of the snapshots now

but let us check how we could improve it.

maybe we can generate a real dart file and trigger the dart linter against it when the tests run. This way we can also cover dart updates in the future if the syntax / common linting rules are changing.

@Parables
Copy link
Contributor

Parables commented Feb 1, 2023

@saihaj please can we get this PR merged now

@Parables
Copy link
Contributor

Parables commented Feb 1, 2023

@MitkoTschimev I love your suggestion... I will get that done ASAP

@saihaj
Copy link
Collaborator

saihaj commented Feb 1, 2023

@MitkoTschimev can you add a changeset for this? run yarn changeset and then do a patch update for the plugin and explain your changes

@MitkoTschimev
Copy link
Contributor Author

Give me a second ;) just coming back from a nursery event from my son :)

@MitkoTschimev
Copy link
Contributor Author

I never worked with changeset but is this correct what happened?
Changeset created a folder and file. Should I commit this one?

image

@Parables
Copy link
Contributor

Parables commented Feb 1, 2023

@MitkoTschimev you can include the before and after code snippet you used in the issue to add a bit of context about the change

@saihaj saihaj merged commit c70b4ce into dotansimha:main Feb 1, 2023
@github-actions github-actions bot mentioned this pull request Feb 1, 2023
@saihaj
Copy link
Collaborator

saihaj commented Feb 1, 2023

https://github.com/dotansimha/graphql-code-generator-community/releases/tag/release-1675282344073

@Parables
Copy link
Contributor

Parables commented Feb 2, 2023

@saihaj please proceed to release this

I will submit another one that addresses some typos and misleading code samples in the guide and the plugin config as well as the live demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants