abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
503 stars 119 forks source link

Reformat codebase #449

Closed zod closed 2 years ago

zod commented 2 years ago

In #446 checkstyle was added to the build but most results suppressed because the code didn't match the expectations.

This reformats all code using the android studio default style and disables the suppressed.

afischerdev commented 2 years ago

I had a view on the file changes, that looks allright. But I'm not sure with the checkstyle workflow . Does it mean all incoming Java file are checked and reported/changed? Or does it only work with Android Studio as editor?

zod commented 2 years ago

But I'm not sure with the checkstyle workflow . Does it mean all incoming Java file are checked and reported/changed? Or does it only work with Android Studio as editor?

It's integrated into gradle. Running ./gradlew check shows all errors reported by checkstyle. There are also more tasks available (checkstyle docs). Because check is also part of ./gradlew build our github action will also report those errors.

Is there a chance to change the rules for switch/case command?

Unfortunately IntelliJ/Android Studio does not support it without manually specifying //@formatter:off for this specific region.

afischerdev commented 2 years ago

@zod Thanks for the clearing. Did you note that there are now some file conflicts?

zod commented 2 years ago

I've rebased the branch onto master and reformatted again. It should now apply cleanly.

zod commented 2 years ago

I've just noticed the failing build but it's too late for today. Will fixup tomorrow.