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

feat(data-point-codemods): Add codemod for changing PathReducer from $. to $ #183

Merged
merged 11 commits into from
Jan 27, 2018

Conversation

paulmolluzzo
Copy link
Collaborator

What: Adds a codemod to change $. to $ if found in a string or template literal

Why: Closes #179

How: http://http://astexplorer.net

Checklist:

  • Has Breaking changes
  • Documentation
  • Tests
  • Ready to be merged
  • Added username to all-contributors list

acatl
acatl previously approved these changes Jan 25, 2018
Copy link
Collaborator

@acatl acatl left a comment

Choose a reason for hiding this comment

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

so cool!

@coveralls
Copy link

coveralls commented Jan 25, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 508a836 on paulmolluzzo:add-codemod-for-pathreducer into ca72293 on ViacomInc:master.

@acatl acatl modified the milestone: v2 Jan 25, 2018
'transform:d': '$',
'transform:e': '$ | foo',
'transform:f': '$ | $ | $',
'transform:g': 'foo | bar | baz'
Copy link
Contributor

Choose a reason for hiding this comment

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

should we have any tests where the $. is nested inside some other kind of reducer?

// just for example
{
  a: ['$.']
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I can add that. Also something like dataPoint.transform('$. | foo', input) too?

Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't hurt

raingerber
raingerber previously approved these changes Jan 25, 2018
}
}

dataPoint.transform('foo | $. | baz | $.')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@raingerber Covering a few more scenarios.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wow. I overlooked this bug, pushed it, and then commented on it, and I still didn’t notice until the CI failed. 🤦‍♂️

@acatl acatl merged commit bb6c7bc into ViacomInc:master Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codemod for PathReducer change of $. to $
4 participants