Enforce `var` vs `FullTypeName` in java 11
- Lingua principale
- Java
- Stelle
- 5.6k
- Fork
- 559
- Merge medio
- 1g 14h
- PR unite (30g)
- 43
Descrizione
The informal Spotless styleguide has been "any style that matters is enforced by spotlessApply". Now that we're compiling against Java 11 world, there's a big new degree of freedom, which is when to use `var` or not.
I'd like to adopt a style which is "you must always use var, unless the line has a comment".
```java
// before spotlessApply
String example = "blah";
// after spotlessApply
var example = "blah";
```
```java
// before spotlessApply
String example = "blah"; // keep type
// after spotlessApply
String example = "blah"; // keep type
```
I'd like it to be a discrete step, ala
```java
spotless { java {
gjf() // or whatever the user is currently using
alwaysUseVarUnlessCommented()
} }
```
But if there's a way to configure an existing formatter, GJF, palantir-java-format, or eclipse, that would work too.
Suggestions and PRs welcome!
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando il punto di ingresso della configurazione Java di Spotless e le integrazioni per GJF, palantir-java-format ed Eclipse menzionate nell'issue. Determina se il comportamento debba essere implementato come un passaggio Java distinto o come una configurazione del formatter; il lavoro è completato quando le dichiarazioni usano var, a meno che un commento di riga non preservi il tipo esplicito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- build-system, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100