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

Allow for the specification of the rustfmt path #571

Closed
wants to merge 1 commit into from

Commits on Feb 26, 2021

  1. Allow for the specification of the rustfmt path

    In some situations, rustfmt can't be counted on to be in your PATH.  In
    those cases, this adds a format_with(...) function to the builder to
    specify the path to rustfmt, which is then passed into the new
    format_with function.
    
    A small dance is done here with fmt(...) and format_with(...) to
    preserve the public API of the crate, so this, if I understand
    correctly, should be an API-compatible change.
    
    I'm not 100% this would be the way I would want to go, but I wanted to
    put it up for discussion.  There are more roundabout approaches I could
    take to format each file in our build system, but I had deferred from
    doing that previously.   The relevant section of a public draft of the
    implementation I had put together is here:
    
    https://github.com/bazelbuild/rules_rust/pull/479/files#r583439508
    
    Also open to suggestions as to where this should be tested.  I didn't
    see, but may have missed, a good place for it.
    David Freese committed Feb 26, 2021
    Configuration menu
    Copy the full SHA
    fd0811d View commit details
    Browse the repository at this point in the history