Skip to content
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

Do not run scalafmt with --quiet #2425

Merged
merged 1 commit into from
Dec 23, 2021
Merged

Do not run scalafmt with --quiet #2425

merged 1 commit into from
Dec 23, 2021

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Dec 23, 2021

This partially reverts #2321.

The --quiet option also suppresses helpful error messages:

$ scalafmt --non-interactive --quiet

$ scalafmt --non-interactive
Invalid config: Default dialect is deprecated; use explicit: [sbt0137,sbt1,scala211,scala212,scala212source3,scala213,scala213source3,scala3]
Also see https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects"
: ~/.scalafmt.conf

Which means we currently get unhelpful error messages like this:

[info] 2021-12-23 16:34:31,733 WARN  Reformatting changed files failed
[info] java.io.IOException: 'scalafmt --non-interactive --quiet --mode changed' exited with code 8
[info] 	at org.scalasteward.core.io.process$.$anonfun$slurp$9(process.scala:54)

With this change, the above exception will contain the message about the
invalid config.

This partially reverts #2321.

The `--quiet` option also suppresses helpful error messages:
```
$ scalafmt --non-interactive --quiet

$ scalafmt --non-interactive
Invalid config: Default dialect is deprecated; use explicit: [sbt0137,sbt1,scala211,scala212,scala212source3,scala213,scala213source3,scala3]
Also see https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects"
: ~/.scalafmt.conf
```
Which means we currently get unhelpful error messages like this:
```
[info] 2021-12-23 16:34:31,733 WARN  Reformatting changed files failed
[info] java.io.IOException: 'scalafmt --non-interactive --quiet --mode changed' exited with code 8
[info] 	at org.scalasteward.core.io.process$.$anonfun$slurp$9(process.scala:54)
```

With this change, the above exception will contain the message about the
invalid config.
@fthomas fthomas added the enhancement New feature or request label Dec 23, 2021
@fthomas fthomas added this to the 0.14.0 milestone Dec 23, 2021
@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #2425 (850132e) into master (69832ea) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2425      +/-   ##
==========================================
- Coverage   80.96%   80.95%   -0.01%     
==========================================
  Files         141      141              
  Lines        2443     2442       -1     
  Branches       54       57       +3     
==========================================
- Hits         1978     1977       -1     
  Misses        465      465              
Impacted Files Coverage Δ
...a/org/scalasteward/core/scalafmt/ScalafmtAlg.scala 94.73% <100.00%> (-0.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69832ea...850132e. Read the comment docs.

@fthomas fthomas merged commit b864c78 into master Dec 23, 2021
@fthomas fthomas deleted the topic/scalafmt-rm-quiet branch December 24, 2021 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant