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

Run autocorrect only when save is trigerred #53

Closed
notsatyarth opened this issue Nov 25, 2019 · 6 comments
Closed

Run autocorrect only when save is trigerred #53

notsatyarth opened this issue Nov 25, 2019 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed improvement
Milestone

Comments

@notsatyarth
Copy link

Right now autocorrect runs on the file by default. This conflicts with the User actions like adding braces, adding empty spaces etc. Would it be possible to trigger auto correct only when the file is being closed and/or manually saved.

@arturbosch arturbosch added help wanted Extra attention is needed improvement good first issue Good for newcomers labels Nov 25, 2019
@dliakhov
Copy link
Contributor

dliakhov commented Nov 30, 2019

I think, better to remove auto-formatting at all, assign it to some action in the IDEA in order to users call it manually.
Because of auto-formatting cause issues like this when I make a git commit command using IDEA.
image

When I removed code which makes auto-formatting this issue becomes non-producible

This action allows users to assign it to hot-key in IDEA, and users will use it when they want.

@dliakhov
Copy link
Contributor

@arturbosch @Satyarths here is PR to disable automatical AutoCorrect functionality and moving it to IDEA action #55

@arturbosch arturbosch added this to the 0.4.0 milestone Dec 16, 2019
@JavierSegoviaCordoba
Copy link

Is there any way to use detekt autoCorrect with the reformat hotkey (cmd opt L - control alt L)?

@arturbosch
Copy link
Member

Unfortunately no one I know. You could configure a custom hotkey.
The save actions plugin (https://github.com/dubreuia/intellij-plugin-save-actions#editor-actions)
supports running arbitrary actions but only for Java plugins I guess.

@JavierSegoviaCordoba
Copy link

The problem is detekt plugin only works with the open file. Reformat code can works for multiple file, for example if I select a package, all files will be formated. Should be great to get the same behavior in detekt.

@arturbosch
Copy link
Member

@JavierSegoviaCordoba feel free to vote on that issue #34 and create ones for new ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed improvement
Projects
None yet
Development

No branches or pull requests

4 participants