Comments (6)
I agree that we shouldn't spend time tweaking and modifying the defaults.
My thinking was just switching which format-style we were using, but keeping it's defaults intact.
It looks like spotless supports a couple styles if you scroll to the "java" section of this:
- java.GoogleJavaFormatStep
- java.PalantirJavaFormatStep
- java.EclipseJdtFormatterStep
The PalantirJavaFormat
style seems like it was specifically made to "fix" the google style, after reading it's README. Maybe they're biased here though.
Also, it looks like spotless has support for other lints apart from just formatting:
- java.RemoveUnusedImportsStep
- java.ImportOrderStep
- java.FormatAnnotationsStep
Should we try enabling any of these? If they work well, they seem like good checks to be performing.
from ice.
Also, to disavow myself of my biases here:
IMO, 4 space indentation is objectively easier to read than 2 spaces
spoken as someone who is currently editing large chunks of the Java tests.
from ice.
I'm fine with 4 or 2, I don't think it makes much of a difference. But I would prefer to keep the Google style default, which is the point of using a style, if we were to start tweaking things here and there we could keep the original style.
from ice.
It would be nice to be able to use the very common Language Support for Java(TM) by Red Hat Java extension for formatting in VS Code. It seems to use the eclipse formatter.
https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings
EDIT: This extension also supports the Google format. I'm going to open a PR to configure it for VS Code.
EDIT 2: Unfortunately these are not compatible. This recommendation from RedHat is quite bad as the XML they reference is abandoned.
from ice.
Unfortunately these are not compatible
Like the 2 tools don't format the code in the same way?
If so, that's indeed pretty lame.
Tomorrow I plan to at least look at enabling the other linting 'spotless' supports, and maybe checking out the other styles it supports. Assuming no one is working on anything big in Java right now (except me).
from ice.
Spotless itself uses tabs for indentation with indent-size = 4.
https://github.com/diffplug/spotless/blob/04d5f28c0401803323b3e8d82677fc081ab2b818/.editorconfig#L5
(I don't think we should use tabs)
from ice.
Related Issues (20)
- PR #2172 broke tracing in C#
- Enabel SSL SNI (Server Name Indication) by default
- Transmit exception message instead of ToString in C#
- Add Service.h back to Ice.h HOT 1
- Remove Glacier2::Application remnants
- Update idle timeout checks in Glacier2 session helper and IceGrid client code
- Remove null checks for string fields
- Add support for serialized method execution HOT 11
- IceBox admin configuration failures on macOS Debug
- Generated Equals for struct mapped to class in C# HOT 1
- Update macOS deployment target for C++ and Swift builds
- how to use on windwos mysys [package] [build] HOT 1
- How to bubble up Java Runtime exceptions HOT 1
- Glacier2/router browser failures
- Reformat C++ code in PHP mapping
- Remove ReapThread from IceGrid
- Fix CA2008 diagnostics in CodeAnalysis.Base.globalconfig
- Generate dispatch with SwiftSyntax in Swift
- Update slice2swift doc-comment generation
- Review handling of OutOfMemoryError in Java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ice.