ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.65k stars 2.24k forks source link

[Dev]: Make formatter automatically break big lines to match the IDE behavior #15143

Closed BrayanDSO closed 5 months ago

BrayanDSO commented 10 months ago
          These were automated changes when I used the inline function in the IDE. 

I was going to revert the changes, but since this is a recurring problem, I wanted to raise an issue to make the formatter automatically do these changes, or use some kind of project shared setting

I can still revert them if asked

_Originally posted by @BrayanDSO in https://github.com/ankidroid/Anki-Android/pull/15140#discussion_r1440000819_

david-allison commented 10 months ago

I've been burned by this in the CardBrowser refactor, strong support

RobozinhoD commented 8 months ago

Hi, I want to fix this. My question is if the line limit should follow Android Studio default of 100 characters or ktlint default of 140 characters https://pinterest.github.io/ktlint/latest/rules/standard/#max-line-length

david-allison commented 8 months ago

For discussion.

I'd propose to bring ktLint to 100 to match Android Studio

[*.{kt,kts}]
max_line_length = off # Use "off" to ignore max line length or a positive number to set max line length

https://pinterest.github.io/ktlint/0.49.0/rules/configuration-ktlint/#max-line-length

BrayanDSO commented 8 months ago

Overall I prefer 100 as well, but that will be a conflict hell, so it needs a quick merge

mikehardy commented 8 months ago

There are going to be so many PRs in flight here through the whole GSoC process and we're still stabilizing 2.17 This sounds like something to do after GSoC, personally. It feels like we're trying to make our lives difficult - even if this were fast it'll be a few days of extra effort when effort is already the limiter

BrayanDSO commented 8 months ago

So, make 140 the default for Android Studio so there aren't any changes to review, so the original issue is fixed.

After GSOC, change it to 100

RobozinhoD commented 8 months ago

Okay, I'll set the default to 140

github-actions[bot] commented 5 months ago

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically