Browse Source

AGENTS.md auto-formatting

master
buttercat1791 2 months ago
parent
commit
c14663dfb1
  1. 10
      AGENTS.md

10
AGENTS.md

@ -66,10 +66,10 @@ REST API at `/api/events` (show, create, delete) with JSON rendering. Uses `Fall @@ -66,10 +66,10 @@ REST API at `/api/events` (show, create, delete) with JSON rendering. Uses `Fall
- If you override the default input classes (`<.input class="myclass px-2 py-1 rounded-lg">)`) class with your own values, no default classes are inherited, so your
custom classes must fully style the input
<!-- usage-rules-start -->
<!-- phoenix:elixir-start -->
## Elixir guidelines
- Elixir lists **do not support index based access via the access syntax**
@ -87,7 +87,7 @@ custom classes must fully style the input @@ -87,7 +87,7 @@ custom classes must fully style the input
Enum.at(mylist, i)
- Elixir variables are immutable, but can be rebound, so for block expressions like `if`, `case`, `cond`, etc
you *must* bind the result of the expression to a variable if you want to use it and you CANNOT rebind the result inside the expression, ie:
you _must_ bind the result of the expression to a variable if you want to use it and you CANNOT rebind the result inside the expression, ie:
# INVALID: we are rebinding inside the `if` and the result never gets assigned
if connected?(socket) do
@ -127,6 +127,7 @@ custom classes must fully style the input @@ -127,6 +127,7 @@ custom classes must fully style the input
<!-- phoenix:elixir-end -->
<!-- phoenix:phoenix-start -->
## Phoenix guidelines
- Remember Phoenix router `scope` blocks include an optional alias which is prefixed for all routes within the scope. **Always** be mindful of this when creating routes within a scope to avoid duplicate module prefixes.
@ -145,6 +146,7 @@ custom classes must fully style the input @@ -145,6 +146,7 @@ custom classes must fully style the input
<!-- phoenix:phoenix-end -->
<!-- phoenix:ecto-start -->
## Ecto Guidelines
- **Always** preload Ecto associations in queries when they'll be accessed in templates, ie a message that needs to reference the `message.user.email`
@ -157,6 +159,7 @@ custom classes must fully style the input @@ -157,6 +159,7 @@ custom classes must fully style the input
<!-- phoenix:ecto-end -->
<!-- phoenix:html-start -->
## Phoenix HTML guidelines
- Phoenix templates **always** use `~H` or .html.heex files (known as HEEx), **never** use `~E`
@ -186,7 +189,7 @@ custom classes must fully style the input @@ -186,7 +189,7 @@ custom classes must fully style the input
...
<% end %>
- HEEx require special tag annotation if you want to insert literal curly's like `{` or `}`. If you want to show a textual code snippet on the page in a `<pre>` or `<code>` block you *must* annotate the parent tag with `phx-no-curly-interpolation`:
- HEEx require special tag annotation if you want to insert literal curly's like `{` or `}`. If you want to show a textual code snippet on the page in a `<pre>` or `<code>` block you _must_ annotate the parent tag with `phx-no-curly-interpolation`:
<code phx-no-curly-interpolation>
let obj = {key: "val"}
@ -233,6 +236,7 @@ custom classes must fully style the input @@ -233,6 +236,7 @@ custom classes must fully style the input
{if @invalid_block_construct do}
{end}
</div>
<!-- phoenix:html-end -->
<!-- usage-rules-end -->
Loading…
Cancel
Save