-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tidy improvements #21619
Tidy improvements #21619
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
One potential issue with this patch is that the |
count_lines = 0 | ||
count_non_blank_lines = 0 | ||
|
||
def update_counts(current_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that using a dictionary to track the file counts will make it easier to maintain in the long run.
# Use a dictionary comprehension to populate file_counts
interesting_files = ['.rs', '.py', '.js']
file_counts = {ext: 0 for ext in interesting_files}
file_counts['other'] = 0
def update_counts(current_name):
global file_counts
_, ext = os.path.splitext(current_name)
if ext in file_counts:
file_counts[ext] += 1
else:
file_counts['other'] += 1
r=me with @iKevinY's comments |
Thanks for the review @iKevinY. Implemented your changes. |
@bors: r=alexcrichton 627c |
@bors: retry |
⌛ Testing commit 627cced with merge 92b6d12... |
💔 Test failed - auto-linux-64-opt |
* tidy - runs all tidy scripts * tidy-basic - tidy.rs * tidy-binaries - check-binaries.py * tidy-errors - errorck.py * tidy-features - featureck.py
This restructures tidy.py to walk the tree itself, and improves performance considerably by not loading entire files into buffers for licenseck. Splits build rules into 'tidy', 'tidy-basic', 'tidy-binaries', 'tidy-errors', 'tidy-features'.
@bors: r=alexcrichton d0e8 |
Builds on my [feature staging PR](#21248) to clean up the tidy scripts a bit, and make them much faster (6s vs ~40s). Adds make rules 'tidy-basic', 'tidy-binaries', 'tidy-errors' and 'tidy-features'. This is the output of `make tidy` here: ``` cfg: version 1.0.0-dev (a8c878d 2015-01-25 01:49:14 -0800) cfg: build triple x86_64-unknown-linux-gnu cfg: host triples x86_64-unknown-linux-gnu cfg: target triples x86_64-unknown-linux-gnu cfg: host for x86_64-unknown-linux-gnu is x86_64 cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu cfg: good valgrind for x86_64-unknown-linux-gnu is 1 cfg: using CC=gcc (CFG_CC) cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS) cfg: valgrind-rpass command set to "/usr/bin/valgrind" --error-exitcode=100 --soname-synonyms=somalloc=NONE --quiet --suppressions=/home/brian/dev/rust3/src/etc/x86.supp --tool=memcheck --leak-check=full cfg: no lualatex found, deferring to xelatex cfg: no xelatex found, deferring to pdflatex cfg: no pdflatex found, disabling LaTeX docs cfg: no pandoc found, omitting PDF and EPUB docs cfg: including test rules cfg: javac not available, skipping lexer test... check: formatting * linted .rs files: 4948 * linted .py files: 27 * linted .js files: 2 * linted .sh files: 5 * linted .pl files: 0 * linted .c files: 28 * linted .h files: 3 * other linted files: 0 * total lines of code: 481217 * total non-blank lines of code: 423682 check: binaries check: extended errors * 249 error codes * highest error code: E0315 check: feature sanity * advanced_slice_patterns lang unstable None * alloc lib unstable None * asm lang unstable None * associated_types lang stable 1.0.0 * box_syntax lang unstable None * collections lib unstable None * concat_idents lang unstable None * core lib unstable None * default_type_params lang stable 1.0.0 * globs lang stable 1.0.0 * hash lib unstable None * if_let lang stable 1.0.0 * import_shadowing lang unstable None * int_uint lang unstable None * intrinsics lang unstable None * io lib unstable None * issue_5723_bootstrap lang stable 1.0.0 * lang_items lang unstable None * link_args lang unstable None * link_llvm_intrinsics lang unstable None * linkage lang unstable None * log_syntax lang unstable None * macro_rules lang stable 1.0.0 * main lang unstable None * managed_boxes lang unstable None * non_ascii_idents lang unstable None * old_impl_check lang unstable None * old_orphan_check lang unstable None * on_unimplemented lang unstable None * opt_out_copy lang unstable None * optin_builtin_traits lang unstable None * os lib unstable None * path lib unstable None * phase lang unstable None * plugin lang unstable None * plugin_registrar lang unstable None * quad_precision_float lang unstable None * quote lang unstable None * rand lib unstable None * rust1 lib stable 1.0.0 * rustc_diagnostic_macros lang unstable None * rustc_private lib unstable None * rustdoc lib unstable None * simd lang unstable None * simd_ffi lang unstable None * slicing_syntax lang unstable None * staged_api lang unstable None * start lang unstable None * std_misc lib unstable None * struct_inherit lang unstable None * struct_variant lang stable 1.0.0 * test lib unstable None * test_accepted_feature lang stable 1.0.0 * test_removed_feature lang unstable None * thread_local lang unstable None * trace_macros lang unstable None * tuple_indexing lang stable 1.0.0 * unboxed_closures lang unstable None * unicode lib unstable None * unsafe_destructor lang unstable None * visible_private_types lang unstable None * while_let lang stable 1.0.0 ``` There's a lot of informational output now, which comes after things like 'NOTE's.
Builds on my feature staging PR to clean up the tidy scripts a bit, and make them much faster (6s vs ~40s).
Adds make rules 'tidy-basic', 'tidy-binaries', 'tidy-errors' and 'tidy-features'.
This is the output of
make tidy
here:There's a lot of informational output now, which comes after things like 'NOTE's.