100phlecs / tailwind_formatter

Sorts tailwind classes within elixir projects
https://hexdocs.pm/tailwind_formatter
MIT License
111 stars 11 forks source link

Plugin should run for client in :test environment #53

Closed chriscrabtree closed 7 months ago

chriscrabtree commented 7 months ago

Context

In a project using tailwind_formatter in both :dev and :test.

Symptoms

MIX_ENV=dev mix format --check-formatted shows tailwind_formatter things to be fixed.

However, MIX_ENV=test mix format --check-formatted runs clean, finding no issues.

Diagnosis

config/config.exs only configures :tailwind in :dev.

Discussion

While the client may be able to configure around this, it seems the default behavior should be consistent between :dev and :test.

Also, I suspect the current behavior contributed to this previously reported issue as well.

PR?

I've forked, fixed, and tested this already. Happy to offer it as a PR.

My main test was performed manually, seeing that the Symptoms described above were resolved. And that the existing tailwind_formatter test suite passed 100%. I did not add any new tests specifically for this situation.

chriscrabtree commented 7 months ago

Sorry, my mistake; I no longer think this is a problem. I'm having --check-formatted issues in CI which contradict my earlier report. There must be something else going on that I don't yet understand.