-
Notifications
You must be signed in to change notification settings - Fork 277
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
Scalafmt seems to ignore COURSIER_REPOSITORIES #3316
Comments
Hey, @PawanKartikS thank you for reporting!
but scalafmt correctly try to resolve from |
I just specified 1 repository, our Nexus endpoint. |
Can you download the scalafmt binary from the Nexus repository? |
|
Hmm, then I have no idea what's going on in your environment 🤔 |
I have an update for you. I'm not sure how relevant it is but I thought I should point it out. When scalafmt is invoked, it very briefly, for a sec, hits our Nexus repo and then switches back to oss.sonatype.org. It happens so quickly that it was nearly impossible to notice. I had to record my screen and move frame by frame to notice this happen. Are there any scenarios where the scalafmt would switch the repo it is using without facing any error? |
That happens if the binary is not found in the repository (that's why I asked "Can you download the scalafmt binary from the Nexus repository?") |
Yes, I just pulled in |
Our environment does not support egress so we use Nexus repository manager. While we are able to use coursier to fetch what we want by specifying
COURSIER_REPOSITORIES
ANDCOURSIER_CREDENTIALS
,scalafmt
seems to hitoss.sonatype.org
while resolving the version specified in the.scalafmt.conf
file. If the former env variable isn't set, it straight away goes to maven. Am I correct in assuming thatscalafmt
supportsCOURSIER_REPOSITORIES
, ref? If it does indeed support it, shouldn't it hit our Nexus instead?Version: 3.5.9
Additional helpful information:
I've tried running
coursier
to fetch something which hit our Nexus and was successful. The next immediate command that I ran wasscalafmt
asscalafmt Foo.scala --debug
which hit some other endpoint/host instead of our Nexus. And because the egress is blocked, it simply sat there with the progress bar at 0%. I've double checked that the env variables are correct. Coursier being able to pull what I've asked for also shows that the configuration is correct.Configuration
Command-line parameters
scalafmt Main.scala --debug
Expectation
I'd expect that
scalafmt
format the code as per its functionality.The text was updated successfully, but these errors were encountered: