diffplug / diffplug/spotless

more flexibility in keeping "sloppy" parts of existing license header

Aperta
#1,611 4 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Java
Stelle
5.6k
Fork
559
Merge medio
1g 14h
PR unite (30g)
43

Descrizione

If you are submitting a **bug**, please include the following:

- [x] summary of problem
- [x] gradle or maven version
- [x] spotless version
- [ ] operating system and version
- [ ] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
- [ ] copy-paste the full content of any console errors emitted by `gradlew spotless[Apply/Check] --stacktrace`

If you're just submitting a feature request or question, no need for the above.

* Spotless 6.16.0
* Gradle 8.0.1
* MacOS Ventura
```

spotless {
java {
licenseHeader 'SPDX-License-Identifier: Apache-2.0'
ignoreErrorForStep('LicenseHeaderStep')
}
}
```

1. Regex

Our large codebase has some variations in copyright specifically in terms of spaces between comment chars & the license text

So our `checkstyle` config (not merged, just trying to find a good tool to add this check since we migrated from maven) becomes
```






```

That seems good enough, so I'm wondering if I can use spotless instead, as it offers more functionality which we may use in future

Obviously we have have a preferred spacing (for auto fix) but want to tolerate additional spaces

I tried without the comments, but then all files fail the check

Interestingly I also wanted to only report warnings, and note that though multiple errors on a project will now be reported, in a multi module build, the build will terminate as that project build fails (unless --continue is used).

Finally, in the example above I'd need two license header steps, but this seems to not be allowed?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo la configurazione Gradle spotless mostrata con `gradlew spotlessCheck` e `gradlew spotlessApply`, quindi segui il passaggio `licenseHeader` e il modo in cui gestisce la spaziatura dei commenti esistenti. Il lavoro è completato quando la spaziatura preferita può ancora essere corretta automaticamente, mentre gli spazi aggiuntivi vengono tollerati, e i molteplici passaggi di intestazione della licenza richiesti sono supportati oppure affrontati chiaramente.

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
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.