binarypaladin
Automated length formatting of doc strings
We’re currently trying to tighten up standards on an existing code base. One of the current topics is about line length, specifically on the @doc strings. While we use the standard 98, I don’t see any obvious way to anything with the doc strings.
I typically keep doc strings to 80 characters. I find it is much easier to read than anything longer. The problem with hard breaks is if you edit something in the middle, you need tools to rewrap. This would be ideal if it was just part of mix format and, perhaps it is already or could be with a little bit of persuasion and I have no idea how to handle it.
Anyone got tips or automated options outside of mix format?
First Post!
NobbZ
You could write a formatter plugin, that registers itself for sigil: [:m] (or uppercase) and write all the do strings using that.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








