Skip to content

Add Ecto formatter config example to "Getting Started" guide#4612

Merged
josevalim merged 4 commits intoelixir-ecto:masterfrom
arcanemachine:arcanemachine-patch-1
Jun 1, 2025
Merged

Add Ecto formatter config example to "Getting Started" guide#4612
josevalim merged 4 commits intoelixir-ecto:masterfrom
arcanemachine:arcanemachine-patch-1

Conversation

@arcanemachine
Copy link
Copy Markdown
Contributor

@arcanemachine arcanemachine commented May 31, 2025

I was following through the Getting Started guide, and noticed that the formatter config was not present in there, so I added a brief section on adding it. Now, I have no more ugly brackets in my Ecto migrations when I follow the guide!

Comment thread guides/introduction/Getting Started.md Outdated
Comment thread guides/introduction/Getting Started.md Outdated
[
# Add these lines to enable Ecto formatter rules
import_deps: [:ecto, :ecto_sql],
subdirectories: ["priv/*/migrations"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory we don't need this, unless you want to have an additional file at priv/*/migrations that imports ecto_sql:

Suggested change
subdirectories: ["priv/*/migrations"],

Copy link
Copy Markdown
Contributor Author

@arcanemachine arcanemachine Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: I misread this at first, maybe let's just remove that line to keep things simple.

Copy link
Copy Markdown
Contributor Author

@arcanemachine arcanemachine Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done.

In theory, it could be better with more info, but that would also distract from the main purpose of the guide: To get started.

At least this gets the reader going with the idea that there are formatter rules, without cluttering up the intro guide too much. So if they run into issues with their migration formatting, and they care to look into it, they at least have some keywords to work with, e.g. "ecto migration formatter"

Comment thread guides/introduction/Getting Started.md Outdated
@josevalim josevalim merged commit 098ea72 into elixir-ecto:master Jun 1, 2025
7 checks passed
@josevalim
Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants