-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Add .mill.sc
as an alternative file extension to .mill
#3461
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kudos for being open to support .mill.sc
as an alternative extension to .mill
!
Having the alternative is probably not ideal and will cause friction since projects will eventually encounter contributors preferring the other version. But we're still experimenting, so it's good to keep any bit of editor support we can get.
My attempts to deal with CI flakiness have gotten a bit out of hand, but hopefully I'll be able to stabilize this enough to get a solid green build |
Took a bit of fiddling because we had to stop using
os.Path#ext
because it only takes the last segment, and also now one of the extensions is a suffix of another. There will likely be a short tail of bugs that arise because of this, but it shouldn't be too burdensome to resolve them. Otherwise this functionality should be relatively cheap to add and maintain since we already have the extensions and file names centralized inCodeGenConstants.java
.This is a compromise between
.mill
and.mill.sc
. I still believe long term.mill
is better, but I can believe that short term pain of having everything not understand your.mill
extensions is painful. This lets people use.mill.sc
where preferable, and.mill
otherwise by default. I expect long term.mill
will be superior once all the tooling has caught up, but until then people can use.mill.sc
if they want the generic.sc
Scala script support that many tools use.Having two extensions isn't that unusual, e.g. Bazel supports both
BUILD
andBUILD.bazel
as file extenions, supported indefinitely. The cost of adding two extensions isn't significantly more than the cost of adding one: in any case we need to send PRs to the various tools, and a PR adding two extensions isn't any more difficult than a PR adding one.Added an example test
13-helper-files-mill-sc
, variant of11-helper-files
, which should exercise most of the file discovery/import/codegen/etc. logic that may be impacted by the extension