Skip to content

Formatter not loading plugins in subdirectory consistently when run from umbrella root #12880

@lukaszsamson

Description

@lukaszsamson

Elixir and Erlang/OTP versions

Erlang/OTP 25 [erts-13.2.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Elixir 1.15.4 (compiled with Erlang/OTP 25)

Operating system

macOS, linux

Current behavior

Repro:

  1. git clone git@github.com:lukaszsamson/elixir_bug_formatter_plugin.git
  2. cd elixir_bug_formatter_plugin
  3. mix deps.get
  4. mix format --check-formatted
** (Mix) mix format failed due to --check-formatted.
The following files are not formatted:

/dir/elixir_bug_formatter_plugin/apps/backoffice/lib/backoffice/templates/some/index.html.heex
  1. mix clean
  2. mix format --check-formatted
    no error
  3. cd apps/backoffice
  4. mix format --check-formatted
** (Mix) mix format failed due to --check-formatted.
The following files are not formatted:

/dir/elixir_bug_formatter_plugin/apps/backoffice/lib/backoffice/templates/some/index.html.heex

It works consistently if I add

plugins: [Phoenix.LiveView.HTMLFormatter],

to root .formatter.exs

Expected behavior

https://hexdocs.pm/mix/main/Mix.Tasks.Format.html#module-formatting-options state about subdirectories:

Configuration between .formatter.exs are not shared nor inherited.

Nothing about interaction between subdirectories and plugins is stated in plugins section.

My expectation is that running formatter in a subdirectory should be equivalent with running it in root. Moreover, it should behave consistently and not depend on wether mix clean has been run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions