-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: Print formatted file names in mix format --verbose #15119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -85,6 +85,35 @@ defmodule Mix.Tasks.FormatTest do | |||||||||||||||||||||||||||
| end) | ||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| test "prints formatted file names with --verbose", context do | ||||||||||||||||||||||||||||
| in_tmp(context.test, fn -> | ||||||||||||||||||||||||||||
| File.write!("a.ex", """ | ||||||||||||||||||||||||||||
| foo bar | ||||||||||||||||||||||||||||
| """) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| File.write!("b.ex", """ | ||||||||||||||||||||||||||||
| foo(bar) | ||||||||||||||||||||||||||||
| """) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Mix.Tasks.Format.run(["a.ex", "b.ex", "--verbose"]) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| assert_received {:mix_shell, :info, ["* formatting a.ex"]} | ||||||||||||||||||||||||||||
| refute_received {:mix_shell, :info, ["* formatting b.ex"]} | ||||||||||||||||||||||||||||
| end) | ||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| test "does not print formatted file names by default", context do | ||||||||||||||||||||||||||||
| in_tmp(context.test, fn -> | ||||||||||||||||||||||||||||
| File.write!("a.ex", """ | ||||||||||||||||||||||||||||
| foo bar | ||||||||||||||||||||||||||||
| """) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Mix.Tasks.Format.run(["a.ex"]) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| refute_received {:mix_shell, :info, ["* formatting a.ex"]} | ||||||||||||||||||||||||||||
| end) | ||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| test "does not print formatted file names with --check-formatted", context do | |
| in_tmp(context.test, fn -> | |
| File.write!("a.ex", """ | |
| foo bar | |
| """) | |
| Mix.Tasks.Format.run(["a.ex, "--check-formatted"]) | |
| refute_received {:mix_shell, :info, ["* formatting a.ex"]} | |
| end) | |
| end |
Uh oh!
There was an error while loading. Please reload this page.