about summary refs log tree commit diff
path: root/src/etc/tidy.py
AgeCommit message (Collapse)AuthorLines
2016-04-12rustbuild: Migrate tidy checks to RustAlex Crichton-230/+0
This commit rewrites all of the tidy checks we have, namely: * featureck * errorck * tidy * binaries into Rust under a new `tidy` tool inside of the `src/tools` directory. This at the same time deletes all the corresponding Python tidy checks so we can be sure to only have one source of truth for all the tidy checks. cc #31590
2016-04-01rustbuild: Fix dist for non-host targetsAlex Crichton-0/+1
The `rust-std` package that we produce is expected to have not only the standard library but also libtest for compiling unit tests. Unfortunately this does not currently happen due to the way rustbuild is structured. There are currently two main stages of compilation in rustbuild, one for the standard library and one for the compiler. This is primarily done to allow us to fill in the sysroot right after the standard library has finished compiling to continue compiling the rest of the crates. Consequently the entire compiler does not have to explicitly depend on the standard library, and this also should allow us to pull in crates.io dependencies into the build in the future because they'll just naturally build against the std we just produced. These phases, however, do not represent a cross-compiled build. Target-only builds also require libtest, and libtest is currently part of the all-encompassing "compiler build". There's unfortunately no way to learn about just libtest and its dependencies (in a great and robust fashion) so to ensure that we can copy the right artifacts over this commit introduces a new build step, libtest. The new libtest build step has documentation, dist, and link steps as std/rustc already do. The compiler now depends on libtest instead of libstd, and all compiler crates can now assume that test and its dependencies are implicitly part of the sysroot (hence explicit dependencies being removed). This makes the build a tad less parallel as in theory many rustc crates can be compiled in parallel with libtest, but this likely isn't where we really need parallelism either (all the time is still spent in the compiler). All in all this allows the `dist-std` step to depend on both libstd and libtest, so `rust-std` packages produced by rustbuild should start having both the standard library and libtest. Closes #32523
2016-02-23mk: Tweak tidy script to work on Windows pythonAlex Crichton-1/+2
The MinGW-based Python implementations would automatically do this, but if we want to use Python from the official downloads our usage of `/` instead of `\` can wreak havoc. In a few select locations just use `os.path.normpath` do do the conversions properly for us.
2016-02-16Add lint to check that all crates have #![unstable]Keith Yeung-0/+18
2016-02-11Add a Cargo-based build systemAlex Crichton-1/+1
This commit is the start of a series of commits which start to replace the makefiles with a Cargo-based build system. The aim is not to remove the makefiles entirely just yet but rather just replace the portions that invoke the compiler to do the bootstrap. This commit specifically adds enough support to perform the bootstrap (and all the cross compilation within) along with generating documentation. More commits will follow up in this series to actually wire up the makefiles to call this build system, so stay tuned!
2015-11-09std: Migrate to the new libcAlex Crichton-1/+2
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-05-24etc: py3 compat for tidy.pyRicho Healey-6/+6
2015-02-23Refactor code in tidy.pyKevin Yap-36/+37
- 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).
2015-02-23Order list of linted files by frequencyKevin Yap-7/+10
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.
2015-02-05Tidy fixesBrian Anderson-0/+1
2015-02-05Address review feedbackBrian Anderson-60/+30
2015-02-05Clean up tidy scripts, coverage, performanceBrian Anderson-49/+155
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'.
2015-01-27Fix PEP8 for tidyRicho Healey-14/+22
2015-01-22Make `make tidy` Python scripts more idiomaticKevin Yap-1/+1
Also makes errorck.py and tidy.py compatible with Python 3.
2015-01-21Rollup merge of #21377 - iKevinY:speedy-tidy, r=huonwBarosl LEE-8/+8
`x in y` is more Pythonic than `y.find(x) != -1`. I believe it runs quite a bit faster as well (though it's probably not a bottleneck of the Travis builds): ```bash $ python -m timeit '"abc".find("a") != -1' 1000000 loops, best of 3: 0.218 usec per loop $ python -m timeit '"a" in "abc"' 10000000 loops, best of 3: 0.0343 usec per loop ```
2015-01-18Use 'in' instead of 'find()' in tidy.pyKevin Yap-8/+8
'x in y' is more Pythonic and faster than 'y.find(x) != -1'.
2015-01-18Ignore NOTEs when Travis runs `make tidy`Kevin Yap-2/+2
Only print NOTE warnings if the 'TRAVIS' environment variable has not been set. Addresses #21322.
2014-04-08Improve searching for XXX in tidy script (#3303)Boris Egorov-2/+3
Few places where previous version of tidy script cannot find XXX: * inside one-line comment preceding by a few spaces; * inside multiline comments (now it finds it if multiline comment starts on the same line with XXX). Change occurences of XXX found by new tidy script.
2014-02-11Change `xfail` directives in compiletests to `ignore`, closes #11363Florian Hahn-3/+3
2014-02-07Added tests to make tidyDerek Guenther-3/+19
2014-02-05etc: add missing license boilerplatesAdrien Tétar-3/+10
2014-02-05etc/tidy: don't check SNAP against tripleAdrien Tétar-4/+5
2014-01-26Changed tidy script to remove restriction on FIXME and to warn against XXX ↵Salem Talha-3/+2
instead
2014-01-05tidy: spew less chaffCorey Richardson-1/+3
2014-01-05Add tidy support for snapshotsCorey Richardson-0/+11
This let's us specify exactly which snapshot a given note to update after snapshot is for. Closes #2483
2013-07-23tidy: allow arbitrary spaces between // and NOTEEtienne Millon-3/+3
`make tidy` now detects `//NOTE`, `// NOTE`, etc. This also removes the extra empty line emitted after each warning. Fixes #6060
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-1/+0
2013-03-12Increase tidy column limit to 100Brian Anderson-1/+1
2013-01-31Finalize moves-based-on-type implementation.Niko Matsakis-1/+1
Changes: - Refactor move mode computation - Removes move mode arguments, unary move, capture clauses (though they still parse for backwards compatibility) - Simplify how moves are handled in trans - Fix a number of illegal copies that cropped up - Workaround for bug involving def-ids in params (see details below) Future work (I'll open bugs for these...): - Improve error messages for moves that are due to bindings - Add support for moving owned content like a.b.c to borrow check, test in trans (but I think it'll "just work") - Proper fix for def-ids in params Def ids in params: Move captures into a map instead of recomputing. This is a workaround for a larger bug having to do with the def-ids associated with ty_params, which are not always properly preserved when inlining. I am not sure of my preferred fix for the larger bug yet. This current fix removes the only code in trans that I know of which relies on ty_param def-ids, but feels fragile.
2013-01-28Change "// WARN" in tidy to "// NOTE" as requested by @catamorphismNiko Matsakis-2/+2
2013-01-28Make tidy actually workNiko Matsakis-3/+3
r=catamorphism
2013-01-28Detect "// WARN" in tidy and print out, well, a warning! UsefulNiko Matsakis-0/+8
for notating FIXME-style-situations that you want to be reminded of before you commit. r=catamorphism
2013-01-17Add a license check to tidy. #4018Brian Anderson-2/+28
2012-08-15In tidy, screen out emacs backup files properlyTim Chevalier-1/+1
2012-07-29Make tidy skip emacs backup filesTim Chevalier-1/+2
2012-07-12Forbid TODO in tidyTim Chevalier-0/+2
Forbid TODO as either a sneaky or an accidental way of evading the requirement to annotate FIXMEs with issue numbers. Of course, there are many other ways to evade this requirement, but one should draw the line somewhere...
2012-06-21Tag all remaining FIXMEs with bugs. Install rule in tidy script to enforce this.Graydon Hoare-1/+6
2012-04-30build: No tidy for test files. Closes #2271Brian Anderson-3/+1
2012-04-17along long lines if they contain error msgsNiko Matsakis-1/+4
2012-02-24Encode/decode AST into metadata, re-instantiate inlined itemsNiko Matsakis-1/+4
2012-01-06report unicode decode failures nicelyNiko Matsakis-13/+14
2011-07-13Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.Graydon Hoare-0/+3
2011-03-19Fix indentation in tidy.Graydon Hoare-1/+1
2010-08-19Use "/usr/bin/env python" per the prevailing stylePatrick Walton-1/+1
2010-08-18Don't complain about \r when core.autocrlf is on in Git... and work in ↵Patrick Walton-4/+13
Python 2.4, 2.6, and 3.x.
2010-08-18Revert "Don't complain about \r when core.autocrlf is on in Git"Patrick Walton-9/+3
This reverts commit 828afaa2fa4cc9e3e53bda0ae3073abfcfa151ca.
2010-08-18Don't complain about \r when core.autocrlf is on in Git (now working with ↵Patrick Walton-3/+9
Python 2.6).
2010-08-18Revert "Don't complain about \r when core.autocrlf is on in Git"Patrick Walton-10/+3
This reverts commit 828afaa2fa4cc9e3e53bda0ae3073abfcfa151ca.
2010-08-18Don't complain about \r when core.autocrlf is on in GitPatrick Walton-3/+10
2010-06-23Populate tree.Graydon Hoare-0/+25