Comments (3)
I agree, it was bothering me when I was working with it too. But in order to keep this consistent we should be using dfmt. Something which comes close to your suggestions with dfmt would be this editorconfig:
[*]
dfmt_brace_style = otbs
dfmt_space_after_keywords = true
dfmt_space_after_cast = true
indent_style = space
indent_size = 2
from ddbus.
I agree auto-formatting would generally be the right thing to do. However, dfmt
actually doesn't really do its full job yet. (For example, when applying otbs
style, it won't add braces to single-line conditionals.)
Also, it does not seem to support a style that places braces the way I'd like them. When limiting our choices to what dfmt
supports, it's tempting to go with 'allman', as it's the only one that places the opening brace of a function on its own line (which I'd really like).
Also, dfmt
doesn't respect a choice to list function parameters vertically when they won't fit on one line. E.g. (from ddbus.exception
)
package T wrapErrors(T)(
T delegate(DBusError *err) del,
string file = __FILE__,
size_t line = __LINE__,
Throwable next = null
) {
// ...
}
gets reformatted by dfmt (otbs
style) like
package T wrapErrors(T)(T delegate(DBusError* err) del, string file = __FILE__,
size_t line = __LINE__, Throwable next = null) {
// ...
}
The first one is definitely more readable.
So yes, dfmt
will certainly help maintaining a consistent formatting, but it won't bring us optimal readability.
from ddbus.
I'm okay with this. If @WebFreak001 is also okay with this, go ahead.
from ddbus.
Related Issues (19)
- dub build failure HOT 5
- Add support for dictionary types HOT 2
- New release HOT 1
- Support for dynamic variants
- What is the intended meaning of isVariant? HOT 2
- DBusAny.get templates for array types don't compile HOT 1
- Crash when using registerMethods HOT 3
- Systembus HOT 1
- Add support for meson HOT 5
- How to list all the removable devices with DBus and UDisks2? HOT 6
- Where is the documentation of Get? HOT 1
- New release since the current one is broken HOT 2
- canDBus returns false for structs HOT 7
- Translate Exception to DBus error Message in MessageRouter.setHandler HOT 1
- API for emitting a signal via dbus?
- Signals are not received (missing a call to dbus_bus_add_match?)
- Unregister signals / router handlers HOT 2
- Add support for emitting signals and properties for server
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 ddbus.