Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Formatting rules #491

Closed
Closed
@slandelle

Description

Discussion started in #487.
We need formatting rules so that contributors can easily provide PR.

It was suggested to use checkstyle. IMHO, that's one hell of a pita. It tried to do (once more) and:

  • It's a crazy non intuitive task to try to come up with non-nazy, pragmatic rules when derivating from Sun ones, all the more with an existing code base.
  • It's almost impossible to have those rules match IDE (which can be eclipse or IntelliJ, or Netbeans) formatter settings (goddamn trailing whitespace in javadoc).

I'm in favor of basic formatting rules that we make explicit and then have contributors make sure they only modify the lines that are related to their change (so bye bye save actions). Anyway, that's IMHO the most basic requirement for any commit, be it an external PR or not.

I suggest:

  • max line length: 120? personally, I use 180 or more but I'm willing to compromise
  • organize imports:
    • no star (same above)
    • order is "org, com, javax, java"
  • 4 spaces indentation

And that's all

@jfarcand @rlubke WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /