-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fixer: Address rename conflicts with explanation #1120
Conversation
57a9aa7
to
cf527d5
Compare
305c454
to
e68f69d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I guess one option for later could be to simply create foo1.rego, foo2.rego, and so on, in case of conflicts, instead of failing.. at least if configured to do so?
return fmt.Errorf("failed to create reporter for format %s: %w", params.format, err) | ||
} | ||
|
||
r.SetDryRun(params.dryRun) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be set any more?
e2e/cli_test.go
Outdated
|
||
import rego.v1 | ||
`, | ||
// these thre files should all be at bar/bar.rego, but they cannot all be moved there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thre -> three / 3
@@ -11,6 +11,15 @@ import ( | |||
"github.com/styrainc/regal/pkg/rules" | |||
) | |||
|
|||
type RenameConflictError struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! We should do more of this.
Fixes StyraInc#1119 Signed-off-by: Charlie Egan <charlie@styra.com>
Now conflicts are reported by type. If they conflict with an existing file, these are shown first. Then, conflicts created by more than one file being moved to the same location are shown after that - if any. Signed-off-by: Charlie Egan <charlie@styra.com>
Signed-off-by: Charlie Egan <charlie@styra.com>
e68f69d
to
c4f122c
Compare
* fixer: Address rename conflicts with explanation Fixes StyraInc#1119 Signed-off-by: Charlie Egan <charlie@styra.com> * fixer: Output the source of conflicts in report Now conflicts are reported by type. If they conflict with an existing file, these are shown first. Then, conflicts created by more than one file being moved to the same location are shown after that - if any. Signed-off-by: Charlie Egan <charlie@styra.com> * fix: Address PR comments Signed-off-by: Charlie Egan <charlie@styra.com> --------- Signed-off-by: Charlie Egan <charlie@styra.com>
* fixer: Address rename conflicts with explanation Fixes StyraInc#1119 Signed-off-by: Charlie Egan <charlie@styra.com> * fixer: Output the source of conflicts in report Now conflicts are reported by type. If they conflict with an existing file, these are shown first. Then, conflicts created by more than one file being moved to the same location are shown after that - if any. Signed-off-by: Charlie Egan <charlie@styra.com> * fix: Address PR comments Signed-off-by: Charlie Egan <charlie@styra.com> --------- Signed-off-by: Charlie Egan <charlie@styra.com>
Fixes #1119