Commit Graph

3 Commits (main)

Author SHA1 Message Date
Mike Frysinger 124bb8e53c switch to 4 space indent
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.

Reformatted using:
files=( $(
	git ls-tree -r --name-only HEAD | \
		grep -Ev -e '^(third_party|recipes)/' | \
		grep '\.py$';
	git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"

The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py

These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py

Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
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