-
Notifications
You must be signed in to change notification settings - Fork 39
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: Regal fix command #653
Conversation
62b6591
to
0460b60
Compare
Also, interested to get thoughts on |
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 work! I'm fine with the direction taken here 👍 Although I'm now leaning more and more towards providing a regal fix
command for a cleaner separation of linting and transformations. I've left some comments here and there for further discussion.
ce211cb
to
3e9faac
Compare
@anderseknert this is ready for review again. I am more happy with the implementation here now. If you agree on the direction & interfaces etc, then I think we can get this in. We might want to add code actions for the whitespace comment and assignment operator too, but these could happen as a follow on PR since this is already kinda large. |
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.
Amazing work on this! The code is really clean, and I had no problems whatsoever following along exactly in what it does. I did have a few thoughts and questions, but this is definitely getting there 😍 Next release is gonna be 💥
c527195
to
68e3cbe
Compare
This is ready for another review. I think we are getting there. Main changes:
|
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.
Terrific! Only some nits, but none of them blocking, so go on and merge when you feel done! 👏
This will be an awesome addition to Regal, and will save a lot of time both for us and others.
WIP while I work on some other fixes to prove out the interfaces. Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
This makes it possible to set the filename and contents in the same place. Next is to standardize the result of a fix too. Signed-off-by: Charlie Egan <[email protected]>
This should allow us to support other type of fix in future Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
Fixes are run repeatedly now and this is not used. Signed-off-by: Charlie Egan <[email protected]>
This is to make it more consistent with rule names Signed-off-by: Charlie Egan <[email protected]>
#653 added fixes for no-whitespace-comment and use-assignment-operator. This PR adds code actions for these in the regal lsp. Signed-off-by: Charlie Egan <[email protected]>
#653 added fixes for no-whitespace-comment and use-assignment-operator. This PR adds code actions for these in the regal lsp. Signed-off-by: Charlie Egan <[email protected]>
#653 added fixes for no-whitespace-comment and use-assignment-operator. This PR adds code actions for these in the regal lsp. Signed-off-by: Charlie Egan <[email protected]>
* lsp: Implement code actions for new fixes #653 added fixes for no-whitespace-comment and use-assignment-operator. This PR adds code actions for these in the regal lsp. Signed-off-by: Charlie Egan <[email protected]> * Move commands under a fix namespace Signed-off-by: Charlie Egan <[email protected]> --------- Signed-off-by: Charlie Egan <[email protected]>
`regal fix` is a new command that is capable of fixing some linter errors: - opa-fmt - use-rego-v1 - no-whitespace-comment - use-assignment-operator Fixes are applied when the input files fail with linter errors. User config is supported. The same fix logic is also used from the language server for code actions.
* lsp: Implement code actions for new fixes StyraInc#653 added fixes for no-whitespace-comment and use-assignment-operator. This PR adds code actions for these in the regal lsp. Signed-off-by: Charlie Egan <[email protected]> * Move commands under a fix namespace Signed-off-by: Charlie Egan <[email protected]> --------- Signed-off-by: Charlie Egan <[email protected]>
At the moment it works like this:
Related to #92