Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [hono-dev] Code style - alignment of fields

Thanks for your input and ideas, guys. So far, we haven't put a lot of effort in enforcing compliance with formatting rules. The most important ones seem to be evident from the code itself and most of the more specific ones I have to admit I personally do not care very much about, e.g. I can live with both indentation styles regarding field declarations.
If the lack of rigidness in this area is making it hard for people to contribute, then IMHO we need to improve on it.
Other opinions?

Kai


Till Markus (INST-CSS/BSV-OS) <Markus.Till@xxxxxxxxxxxx> schrieb am Mo., 13. März 2017, 09:58:

Hi,

to me it always was kind of error prone to depend on IDE settings to get a consistent formatting for a project.

Would it may be an idea to introduce some maven based approach to enforce styling e.g. checkstyle. This also could be used to enforce the eclipse settings. In addition it would address the issue of already nonstandard formatted code in the project and can be later used as build breaker.

 

Just an idea…

 

Greetings!

 

 

Markus Till

 

Bosch Software Innovations GmbH

Schöneberger Ufer 89-91

10785 Berlin

GERMANY

Von: hono-dev-bounces@xxxxxxxxxxx [mailto:hono-dev-bounces@xxxxxxxxxxx] Im Auftrag von Lohmann Carsten (INST/ECS4)
Gesendet: Montag, 13.
März 2017 09:45
An: hono-dev@xxxxxxxxxxx
Betreff: [hono-dev] Code style - alignment of fields

 

Hi,

when formatting the code using the checked-in eclipse code style settings, the alignment of fields looks odd;
e.g. VertxBasedRestProtocolAdapter:

    private HttpServer                                              server;
    private HonoClient                                              hono;
    private HonoConfigProperties                                    config;

    private BiConsumer<String, Handler<AsyncResult<MessageSender>>> eventSenderSupplier;
    private BiConsumer<String, Handler<AsyncResult<MessageSender>>> telemetrySenderSupplier;



With the additional eclipse formatter setting "Blank lines separating independent groups: 1", it would look better:

    private HttpServer           server;
    private HonoClient           hono;
    private HonoConfigProperties config;

    private BiConsumer<String, Handler<AsyncResult<MessageSender>>> eventSenderSupplier;
    private BiConsumer<String, Handler<AsyncResult<MessageSender>>> telemetrySenderSupplier;


Or can the field alignment setting be disabled altogether?
Many classes are currently not formatted according to this setting anyway (also
VertxBasedRestProtocolAdapter).

--
Best regards

Carsten Lohmann

Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY

_______________________________________________
hono-dev mailing list
hono-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/hono-dev

Back to the top