Commit Graph

2 Commits (8e77bba1aebf5a675cae6ef45079a080134ebfc6)

Author SHA1 Message Date
Aleksey Khoroshilov 6e33ba049f Use rustfmt from third_party/rust-toolchain/bin directory.
Chromium now has rust toolchain in a well-established directory, which is properly gated with `use_rust` gclient variable. External projects can setup this directory using their own toolchains and have rustfmt work properly in presubmit format checks.

Bug: 1395070
Change-Id: I3d1de8278b9da0db1cdb75673cb7d637ce0273ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4070004
Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: danakj <danakj@chromium.org>
2 years ago
Lukasz Anforowicz b4d3954db7 [rust] [depot_tools] Minimal `rustfmt` support for `git cl format`.
This CL provides minimal `git cl format` support to enforce correct Rust
formatting in presubmit checks.  For now the files are always fully
formatted - there is no support at this point for formatting only the
changed lines.

Manual tests (after temporarily, artificially introducing a formatting
error to one of .rs files under build/rest/tests):

*) git cl presubmit
   Result: The src directory requires source formatting.
           Please run: git cl format

*) git cl format --dry-run
   Result: Pretty/colorful diff printed out.

*) git cl format
   Result: Temporary formatting errors are fixed.

Bug: chromium:1231317
Change-Id: I114ece90630476f27871ebcd170162caa92c0871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3054980
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: danakj <danakj@chromium.org>
3 years ago