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

fixer: add --on-conflict flag to support renaming #1127

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

charlieegan3
Copy link
Member

This PR adds a new flag to the fix command, --on-conflict. This flag can be used to specify the behavior of the fix command when a file's new name conflicts with an existing file or another file's fixed name.

Setting --on-conflict to "rename" will cause the fix command to rename the file to a different name at the target location. The new name will be generated by appending a number to the end of the file name.

This PR adds a new flag to the fix command, `--on-conflict`. This flag
can be used to specify the behavior of the fix command when a file's new
name conflicts with an existing file or another file's fixed name.

Setting --on-conflict to "rename" will cause the fix command to rename
the file to a different name at the target location. The new name will
be generated by appending a number to the end of the file name.

Signed-off-by: Charlie Egan <charlie@styra.com>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

Looks great!

- directory-package-mismatch
quz/foo.rego -> foo/foo_1.rego:
- directory-package-mismatch
quz/foo_test.rego -> foo/foo_1_test.rego:
Copy link
Member

Choose a reason for hiding this comment

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

nice 👍

@charlieegan3 charlieegan3 merged commit 23cb827 into StyraInc:main Sep 23, 2024
4 checks passed
@charlieegan3 charlieegan3 deleted the rename-on-conflict branch September 23, 2024 14:45
srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
This PR adds a new flag to the fix command, `--on-conflict`. This flag
can be used to specify the behavior of the fix command when a file's new
name conflicts with an existing file or another file's fixed name.

Setting --on-conflict to "rename" will cause the fix command to rename
the file to a different name at the target location. The new name will
be generated by appending a number to the end of the file name.

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this pull request Jan 6, 2025
This PR adds a new flag to the fix command, `--on-conflict`. This flag
can be used to specify the behavior of the fix command when a file's new
name conflicts with an existing file or another file's fixed name.

Setting --on-conflict to "rename" will cause the fix command to rename
the file to a different name at the target location. The new name will
be generated by appending a number to the end of the file name.

Signed-off-by: Charlie Egan <charlie@styra.com>
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.

2 participants