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

Introduce rustfmt in a non-invasive manner #1040

Merged
merged 8 commits into from Jul 19, 2022

Commits on Jul 19, 2022

  1. Add a rustfmt configuration file with explicit ignores

    Add a configuration file but explicitly ignore all source files. The aim
    of this is that we can then un-ignore files a few at a time and deal
    with issues in a small isolated manner.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    fd1c658 View commit details
    Browse the repository at this point in the history
  2. Run formatter on examples/

    Remove "examples" from the rustfmt ignore list.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    6461e2d View commit details
    Browse the repository at this point in the history
  3. Refactor compile_error message

    In preparation for enabling rustfmt on `lib.rs` refactor the
    `compile_error` call so that the formatter does not touch it.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    65d19d9 View commit details
    Browse the repository at this point in the history
  4. Shield hash_newtypes from rustfmt

    In preparation for running the formatter on root level modules and a
    submodule that holds all the macro calls in `hash_types` so we can
    configure rustfmt to skip formatting them.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    01471f7 View commit details
    Browse the repository at this point in the history
  5. Do not format prelude module

    In preparation for running the formatter on all source files at the root
    of the crate; skip formatting `prelude` module because we use
    unconventional import statements so they to save writing a million
    compiler attributes.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    7b50a96 View commit details
    Browse the repository at this point in the history
  6. Use f instead of formatter

    The local variable `formatter` can be shortened to `f` with no loss of
    clarity since it is so common.
    
    Done in preparation for running `rustfmt` on `src`.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    fd217e7 View commit details
    Browse the repository at this point in the history
  7. Add use for Unexpected

    In preparation for running the formatter on `src/` and a function local
    use statement for `$crate::serde::de::Unexpected`, this shortens the
    line of code that uses this type preventing the formatter for later
    munging that line.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    743b197 View commit details
    Browse the repository at this point in the history
  8. Enable formatter for "src"

    Remove the ignore for the "src" directory, this enables the formatter
    for all source files in the `src/` directory.
    tcharding committed Jul 19, 2022
    Copy the full SHA
    ee9a3ec View commit details
    Browse the repository at this point in the history