Skip to content

Order list of files linted in tidy.py by frequency #22029

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

Merged
merged 2 commits into from
Mar 6, 2015
Merged

Order list of files linted in tidy.py by frequency #22029

merged 2 commits into from
Mar 6, 2015

Conversation

iKevinY
Copy link
Contributor

@iKevinY iKevinY commented Feb 7, 2015

Currently, the list of files linted in tidy.py is unordered. It seems more appropriate for more frequently appearing files (like .rs) to appear at the top of the list and for "other files" to appear at the very end. This PR also changes the wildcard import of check_license() into an explicit one.

Before:                     After:
* linted 4 .sh files        * linted 5034 .rs files
* linted 4 .h files         * linted 29 .c files   
* linted 29 .c files        * linted 28 .py files  
* linted 2 .js files        * linted 4 .sh files   
* linted 0 other files      * linted 4 .h files    
* linted 28 .py files       * linted 2 .js files   
* linted 5034 .rs files     * linted 0 other files 

r? @brson

@iKevinY
Copy link
Contributor Author

iKevinY commented Feb 7, 2015

Added another commit that refactors tidy.py a bit (I figured it's minor enough to include in this PR).

Edit: Squashed the commit that removed the wildcard import into 9569691.

Since it makes more sense for .rs files to appear at the top of the
list of linted files and "other" files to appear at the end, this
commit moves the "other" count outside of the `file_counts` dictionary
and sorts the remaining "interesting" files by decreasing frequency.
- Replace wildcard import with explicit import of `check_license`
- Move more logic outside of the `try` block.
- Group all helper functions together.
- Define `interesting_exts` and `uninteresting_files` at start of file
  (with the rest of the constant declarations).
@brson
Copy link
Contributor

brson commented Mar 4, 2015

@bors: rollup r+

Sorry for missing this for so long.

@bors
Copy link
Collaborator

bors commented Mar 4, 2015

@bors r=brson 9569691

@iKevinY
Copy link
Contributor Author

iKevinY commented Mar 4, 2015

@brson No worries; glad it could be merged in!

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 4, 2015
 Currently, the list of files linted in `tidy.py` is unordered. It seems more appropriate for more frequently appearing files (like `.rs`) to appear at the top of the list and for \"other files\" to appear at the very end. This PR also changes the wildcard import of `check_license()` into an explicit one.

```
Before:                     After:
* linted 4 .sh files        * linted 5034 .rs files
* linted 4 .h files         * linted 29 .c files
* linted 29 .c files        * linted 28 .py files
* linted 2 .js files        * linted 4 .sh files
* linted 0 other files      * linted 4 .h files
* linted 28 .py files       * linted 2 .js files
* linted 5034 .rs files     * linted 0 other files
```

r? @brson
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 5, 2015
 Currently, the list of files linted in `tidy.py` is unordered. It seems more appropriate for more frequently appearing files (like `.rs`) to appear at the top of the list and for \"other files\" to appear at the very end. This PR also changes the wildcard import of `check_license()` into an explicit one.

```
Before:                     After:
* linted 4 .sh files        * linted 5034 .rs files
* linted 4 .h files         * linted 29 .c files
* linted 29 .c files        * linted 28 .py files
* linted 2 .js files        * linted 4 .sh files
* linted 0 other files      * linted 4 .h files
* linted 28 .py files       * linted 2 .js files
* linted 5034 .rs files     * linted 0 other files
```

r? @brson
@bors bors merged commit 9569691 into rust-lang:master Mar 6, 2015
@iKevinY iKevinY deleted the tidy-changes branch March 6, 2015 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants