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

Add initial formatter implementation #2883

Merged
merged 16 commits into from
Feb 15, 2023
Merged

Add initial formatter implementation #2883

merged 16 commits into from
Feb 15, 2023

Commits on Feb 15, 2023

  1. Configuration menu
    Copy the full SHA
    8a8c748 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c3adfb6 View commit details
    Browse the repository at this point in the history
  3. refactor(ruff_fmt): More idiomatic use of formatter API (#3)

    This PR makes the formatter code more idiomatic by:
    
    * Unifying sequential `write!` calls into a single `write`
    * Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
    * Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
    * Use `space` instead of `text(" ")`
    MichaReiser authored and charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    d2bb161 View commit details
    Browse the repository at this point in the history
  4. refactor(ruff_fmt): Replace rome_rowan dependency with `rome_text_s…

    …ize` (#2)
    
    Remove the `rome_rowan` dependency from `ruff_fmt` and use `rome_text_size` directly.
    
    This is just an aesthetic cleanup that does not improve compile time because `ruff_fmt` depends on `rome_formatter` which depends on `rome_rowan`.
    MichaReiser authored and charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    3a801f0 View commit details
    Browse the repository at this point in the history
  5. Add a smoke test to ruff_fmt to debug formatter changes (#4)

    Adds a smoke test to `ruff_fmt` to debug formatter changes.
    
    This PR changes the return value of `fmt` to `Result<Formatted>` to allow printing the formatted IR in the quick test. The motivation behind returning `Formatted` is that the IR represents the formatted source code. Printing it only changes its representation from the IR to a string.
    MichaReiser authored and charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    51d04ad View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b219d5c View commit details
    Browse the repository at this point in the history
  7. Run cargo fmt (#8)

    charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    41c10f8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8081cf5 View commit details
    Browse the repository at this point in the history
  9. Add a hacky mechanism for allowing string adjustments in tests (#9)

    It's nice to be able to track tests that are "almost" passing, modulo string normalization, so this PR adds a dedicated section for snippets that fit that description.
    charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    20d7c95 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1472abc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    4f216b3 View commit details
    Browse the repository at this point in the history
  12. Create remaining simple_cases fixtures (#12)

    Removes all the other fixtures, runs the conversion script over all remaining cases, and removes the `.bak` files.
    charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    d1a7f5e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d8802ed View commit details
    Browse the repository at this point in the history
  14. Point to local crates

    charliermarsh committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    811a2e2 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    6c4a44f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    7c2be15 View commit details
    Browse the repository at this point in the history