Skip to content

Option to only run if rustfmt.toml exists #4

Open

Description

@Ogeon

It would be nice to have an option to only run rustfmt if there's a rustfmt.toml file in the crate root. This would make it easier to selectively enable automatic formatting for individual projects.

Activity

  1. vincenting commented on Aug 10, 2016

    @vincenting
    Owner

    Hi, Please upgrade to version 0.3.0 and try our new feature(args support for rustfmt).

  2. Ogeon commented on Aug 10, 2016

    @Ogeon
    Author

    Does rustfmt really have such an option? I can't find it.

  3. vincenting commented on Aug 11, 2016

    @vincenting
    Owner

    @Ogeon Try to upgrade your rustfmt with following commands:

    • cargo uninstall rustfmt
    • cargo install rustfmt

    Then you will find its usage by rustfmt --help

  4. Ogeon commented on Aug 11, 2016

    @Ogeon
    Author

    Sure, but which flag? Do you mean --config-path? It will just use the default settings if it can't find a config file. What I'm talking about is making it not run at all if there is no config file. I tested with rustfmt --config-path ./ src/lib.rs in the root of one of my projects.

  5. vincenting commented on Aug 11, 2016

    @vincenting
    Owner

    Sorry Ogeon, I misunderstood your intentions.
    I'll think about it (maybe add a new config in package setting), to disable rustfmt unless rustfmt.toml exists in the next coming version.

    Thank you for your advice.

  6. self-assigned this
    on Aug 11, 2016
  7. Ogeon commented on Aug 11, 2016

    @Ogeon
    Author

    No worries. 😄 I think a config parameter would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions