https://github.com/kociamber/elf
LiveView powered online Elixir code formatter and Credo analyser.
https://github.com/kociamber/elf
elixir elixir-phoenix phoenix phoenix-framework phoenix-liveview
Last synced: about 1 month ago
JSON representation
LiveView powered online Elixir code formatter and Credo analyser.
- Host: GitHub
- URL: https://github.com/kociamber/elf
- Owner: Kociamber
- Created: 2019-11-20T18:20:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:19:57.000Z (over 3 years ago)
- Last Synced: 2025-12-31T21:16:39.110Z (6 months ago)
- Topics: elixir, elixir-phoenix, phoenix, phoenix-framework, phoenix-liveview
- Language: Elixir
- Size: 11.8 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elixir LiveView Formatter
__WIP!__
[LiveView](https://github.com/phoenixframework/phoenix_live_view) powered in-browser Elixir code formatter and Credo analyser.
What is [LiveView](https://github.com/phoenixframework/phoenix_live_view)? In short - you can write real-time user interaction code with pure Elixir and get rid off JS!
The functionality is there, now I just need to add some decent CSS styling.
Please bear in mind that Credo is picking up the code wrapped around module (`defmodule`) or function (`def`) definitions, ie - this ugly code will be picked up:
```elixir
def mount(_session, socket) do
if true do
if true do
if true do
assigns =
socket
|> assign(:assign_me, 1)
|> assign(:assign_me_too, "value")
|> assign(:hairy, "cattos")
end
end
end
{:ok, assigns}
end
```
and this one will not:
```elixir
if true do
if true do
if true do
assigns =
socket
|> assign(:assign_me, 1)
|> assign(:assign_me_too, "value")
|> assign(:cattos, "furry")
end
end
{:ok, assigns}
```
# Install and run locally
* Clone repo with `git clone https://github.com/Kociamber/elf.git`
* Install dependencies with `mix deps.get`
* Install Node.js dependencies with `cd assets && npm install && cd ..`
* Start Phoenix endpoint with `mix phx.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
# TODO
* work with CSS on some nice layout
* allow formatting without wrapping code around with `def` and `end` or display
a message
* release to hex, host the thing online, add Travis CI