Skip to content

Add source code formatting? #33

@mikavilpas

Description

@mikavilpas

This issue is to open a discussion on whether the project should have a source code formatter taken into use.

Why use a formatter?

What benefits could it bring?

  • all code would look exactly the same so it's easier to reason about
  • coding becomes easier as developers don't have to pay any attention to formatting

What does it do exactly?

A formatter typically has the following functions:

  • it integrates into the IDE and automatically formats the current file when it is saved
  • it integrates to pull requests and fails the CI build in case the PR's code is not correctly formatted

Thus adding a formatter would need the following:

  • every developer must install an IDE plugin OR they have to run an extra formatting command before submitting their PR
  • a CI build needs to be created

My suggestion

I have previously worked with a java formatter called google-java-format which has good plugins for IDEA, Android Studio (I have no personal experience using it with Android Studio) and I think one developer used it with Eclipse. The formatting style in this formatter is not configurable at all, you can literally change nothing, I think. This means it's extremely opinionated but also very easy to set up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions