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

Add dryRun flag to CodeTransform invocations #613

Merged
merged 2 commits into from Dec 11, 2018

Conversation

cdupuis
Copy link
Member

@cdupuis cdupuis commented Dec 11, 2018

This adds a new parameter to the invocation of CodeTransforms: When specified dryRun=true the transform will not commit its changes and instead the git diff will get sent back to the person invoking the command.

This is useful for testing transforms across a large set of the repos.

Oh, and cleaned up a couple of unused imports.

@cdupuis cdupuis added changelog:added Add this issue or pull request to added changelog section auto-merge:on-approve Auto-merge on review approvals labels Dec 11, 2018
Copy link
Contributor

@ddgenome ddgenome left a comment

Choose a reason for hiding this comment

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

A couple minor things.

`Code transform ${italic(editorName)} made no changes to ${bold(slug)}`));
} else if (isDryRun(params)) {
const gitDiffResult = await execPromise("git", ["diff"], { cwd: project.baseDir });
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably wrap in a try/catch block to be safe.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@ddgenome ddgenome left a comment

Choose a reason for hiding this comment

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

LGTM

@atomist-bot atomist-bot merged commit abd7400 into master Dec 11, 2018
@atomist-bot
Copy link
Contributor

Pull request auto merged by Atomist.

[atomist:generated] [auto-merge:on-approve]

@atomist-bot atomist-bot deleted the code-transform-dry-run branch December 11, 2018 23:35
atomist-bot added a commit that referenced this pull request Dec 11, 2018
[atomist:generated]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge:on-approve Auto-merge on review approvals changelog:added Add this issue or pull request to added changelog section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants