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
Updates the Scalafmt documentation to reflect the current API. Adds a
check to `scala_toolchains_repo` to `fail` if the Scalafmt
`default_config` file doesn't exist.
The previous commit doesn't actually restore the exact pre-bazel-contrib#1725 API.
It eliminates the `exports_files` requirement, but still requires a
`Label`, not just a relative path string or a `.scalafmt.conf` in the
root directory.
After experimenting a bit and thinking this through, it seems the
explicit `Label` requirement provides the most robust and reliable
interface. Specifically, supporting the previously optional
`.scalafmt.conf` in the root directory requires detecting whether it
actually exists before falling back to the default. Having users
explicitly specify their own config seems a small burden to impose for a
more straightforward and correct implementation.
At the same time, I saw the opportunity to provide the user with
explicit feedback if the specified config file doesn't exist. Hence the
new check and `fail()` message.
Also renamed the generated `.scalafmt.conf` file in
`@rules_scala_toolchains//scalafmt` to `scalafmt.conf`. No need for it
to be a hidden file in that context.
0 commit comments