You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NB: before submitting, please confirm that the problem is observed in the latest published version of the formatter! We don't publish hotfixes for older
versions, and the problem you have observed in an older version may have already
been fixed.
Command-line parameters (required)
When I run scalafmt via CLI like this: scalafmt --check
Steps
Any directory with scripts having the following hashbang line causes problems:
If the file ./classpathAtfile is not found, a warning is printed, and in any case, as long as scala in the PATH is scala 3, the script prints hello.
It's also necessary that /usr/bin/env accept the -S option, as is the case for recent versions.
The result is equivalent to invoking the script via the following command line:
scala @classpathAtfile biz.sc
In this simple hello world example, the file classpathAtfile can be empty, and need not exist. In general, it's a way to set the classpath.
Workaround
On the command line, pass a list of all directories other than those with the offending script hashbang lines.
A better workaround would be to be able to exclude a directory in .scalafmt.conf, or similar.
The text was updated successfully, but these errors were encountered:
Configuration (required)
NB: before submitting, please confirm that the problem is observed in the
latest published version of the formatter! We don't publish hotfixes for older
versions, and the problem you have observed in an older version may have already
been fixed.
Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt --check
Steps
Any directory with scripts having the following
hashbang
line causes problems:Problem
Scalafmt rejects the hashbang line, complaining about the @ character:
Another possibly related rejection is the following script
hashbang
:philwalk@d5 MINGW64 ~/work
Expectation
If the file
./classpathAtfile
is not found, a warning is printed, and in any case, as long asscala
in thePATH
isscala 3
, the script printshello
.It's also necessary that
/usr/bin/env
accept the-S
option, as is the case for recent versions.The result is equivalent to invoking the script via the following command line:
In this simple
hello world
example, the fileclasspathAtfile
can be empty, and need not exist. In general, it's a way to set the classpath.Workaround
On the command line, pass a list of all directories other than those with the offending script
hashbang
lines.A better workaround would be to be able to exclude a directory in
.scalafmt.conf
, or similar.The text was updated successfully, but these errors were encountered: