Commit Graph

28 Commits

Author SHA1 Message Date
Josh Matthews
d1f1ba555f servo: Merge #7203 - Add automated style nit checks to test-tidy (from jdm:style); r=Ms2ger
Expands on the work by @wilmoz and cleans up the existing errors. Closes #7180. Closes #7111.

Source-Repo: https://github.com/servo/servo
Source-Revision: e74825f9fde8e222f4ba9bb24b2c2a3864c73e5f
2015-08-16 08:37:40 -06:00
Ms2ger
d4eb089426 servo: Revert "Auto merge of #7103 - frewsxcv:python-venv, r=metajack" for breaking web-platform-tests.
This reverts commit c315404db80c92a695531b0aa4bcf61c125a3bff, reversing
changes made to b00583bd4e7169a6b952633df718268904f2bd0c.

Source-Repo: https://github.com/servo/servo
Source-Revision: 47d6d958f58f5011742a18abcdd5a76bf4390966
2015-08-09 11:20:40 +02:00
Corey Farwell
a6d47c51ae servo: Merge #7103 - Use one Python virtual environment for all mach commands (from frewsxcv:python-venv); r=metajack
*See individual commits for more information*

Source-Repo: https://github.com/servo/servo
Source-Revision: c315404db80c92a695531b0aa4bcf61c125a3bff
2015-08-08 19:42:14 -06:00
Corey Farwell
f015c2a627 servo: Merge #7076 - Remove invalid file path in ignored_files for tidying (from frewsxcv:tidy-rm-invalid-file); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: c202d7b2f6ddf5709a59643a7e62aa2f763adf11
2015-08-07 16:32:04 -06:00
Corey Farwell
74242164b9 servo: Merge #6996 - Prevent flake8 from crashing tidy (from frewsxcv:prevent-tidy-crash); r=jdm
If someone were to write:

    def hello() :
        print "hello world"

flake8 would warn:

    stdin:54:45: E203 whitespace before ':'

Normally there are only three colons in a flake8 error message, but this
one has four, which causes issue with this line:

    _, line_num, _, message = error.split(":")

...causing this error:

    ValueError: too many values to unpack

This commit updates the `str.split` call to utilize the `maxsplit`
parameter to prevent this error from occurring.

Source-Repo: https://github.com/servo/servo
Source-Revision: 729e003c5d954694e3fa6fd2b72702515ef94c6c
2015-08-06 02:32:43 -06:00
Bogdan Cuza
5698c2dc64 servo: Merge #6714 - Implement a FileList (from boghison:filelist); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: b7261a2073dcb66473907dbb25282f05f9bfe3d3
2015-08-01 20:16:14 -06:00
Bogdan Cuza
6e1df04706 servo: Merge #6699 - Tidy check for FooMethods in components/script/dom/*.rs and color for tidy (from boghison:tidyspec); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 14ccb22e679722ed3374c8facec21adcf0f2b247
2015-07-28 08:56:39 -06:00
Corey Farwell
2eb4f27674 servo: Merge #6777 - Cleanup lint special cases, refactor flake8 linting (from frewsxcv:refactor-tidy); r=jdm
Currently, there are a few linting functions that only run on certain
filetypes (determined by the file extension). Prior to this commit, the
special cases were handled in a parent function with a conditional. This
commit changes the system so each linting function gets passed a
filename so the function can determine whether it should run or not
based on the file extension.

I also refactored flake8 linting slightly. From what I've read so far of
the code, flake8 itself will only print the results directly to stdout
(though the linter would report the quantity of errors detected).
Prior to this commit, we would let flake8 print directly to stdout and
just determine if there were >0 errors reported. This commit (sort of
hackily) temporarily captures stdout when we call flake8 so we can do
what we want with the output, allowing us to `yield` the line number
and message like we do with the other linting functions.

In my opinion, both of these changes isolate specific behaviors/checks
into their respective linting functions instead of having them handled
at a more global level.

In addition to the changes above:

* The whitespace linter now runs on WebIDL and TOML files
* The license header linter now runs on WebIDL files

Source-Repo: https://github.com/servo/servo
Source-Revision: 7c8922c0c39616559b580b4a363ebe2a8c6b3ba8
2015-07-27 04:39:04 -06:00
Michael Howell
32dbe8196b servo: Merge #6693 - Tidy finds WebIDLs with no spec (from notriddle:tidy-webidl); r=jdm
Closes #6689

Source-Repo: https://github.com/servo/servo
Source-Revision: 11a3423c29369e712ca1ce38417b9f9cf6845fd7
2015-07-22 13:44:12 -06:00
Bogdan Cuza
a7c587c432 servo: Merge #6648 - Make tidy check for "*" in toml files (from boghison:tidytoml); r=jdm
This checks every .toml file for an asterisk and prints an error if found.

Source-Repo: https://github.com/servo/servo
Source-Revision: 58e9bc6583b6ebbeb27e3b28a6b271ee48cd695a
2015-07-20 14:43:05 -06:00
Corey Farwell
71e5369f68 servo: Merge #6580 - Remove tidy blacklist for 'script/dom/bindings/*' (from frewsxcv:lint-codegen); r=Ms2ger
Recently, I found myself reading through the Python codegen scripts that
live in 'components/script/dom/bindings/*' and noticed that there were
many tidy violations: unnecessary semicolons, weird spacing, unused
variables, lack of license headers, etc. Considering these files are now
living in our tree and mostly maintained directly by contributors of
Servo (as opposed to being from upstream), I feel these files should not
be excluded from our normal tidy process. This commit removes the
blacklist on these files and fixes all tidy violations.

I added these subdirectories to the blacklist because they appear to be
maintained upstream somewhere else:

* "components/script/dom/bindings/codegen/parser/*",
* "components/script/dom/bindings/codegen/ply/*",

Also, I added a few '# noqa' comments which tells us to ignore the
flake8 errors for that line; they are mostly for unused/undefined
variables. I chose to ignore these (instead of fixing them) to make the
work for this commit simpler for me.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d2a340633dcc73e458a8454b78e26ba93511d37
2015-07-09 07:55:27 -06:00
Jack Moffitt
3c2edf76c4 servo: Merge #6306 - Use Cargo's target directory sharing (from metajack:shared-target-dir); r=mbrubeck
This speeds up `./mach build --dev` followed by `./mach build-cef` by
25%. When rust-lang/cargo#497 is fixed, this speedup will increase
dramatically.

Source-Repo: https://github.com/servo/servo
Source-Revision: d6263c9b6e969fde4c644034e684a39d68667ad9
2015-06-15 13:08:14 -06:00
Corey Farwell
f5288dcad8 servo: Merge #6279 - Add flake8 to the tidy process for Python files (from frewsxcv:flake8); r=jdm
Fixes #6236

Also included in this commit are the changes need to make flake8 pass
for the existing python file

Source-Repo: https://github.com/servo/servo
Source-Revision: ccfe29d8f284dedc0101045d574a98fb1f69aa62
2015-06-04 10:41:36 -05:00
Corey Farwell
fe64f1f685 servo: Merge #6274 - Run tidy everything in the tree, remove directory whitelist (from frewsxcv:tidy-all-the-things); r=metajack
After #6268 merged, I found out that everything in the tree currently
passes the tidy checker.

---------------

It is worth pointing out that I personally do not know if this is a feature wanted by others. Once I noticed everything was already tidy, I decided to open this PR to start the conversation (if any). I am not convinced this is really a Good Thing, so my feelings would not get hurt if this was closed immediately.

Source-Repo: https://github.com/servo/servo
Source-Revision: 055182dae1d895ba2422e3da85c20a9a64beea71
2015-06-03 11:12:34 -05:00
Corey Farwell
047a07ab93 servo: Merge #6268 - Tidy files in python/, fix issues brought up by tidy (from frewsxcv:tidy-python); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 9aa1d932828d15f6590816c638af1e3f451130a4
2015-06-03 08:04:11 -05:00
Corey Farwell
3d43073796 servo: Merge #6174 - Reduce max line length from 150 to 120 characters (from frewsxcv:cleanup-long-lines); r=SimonSapin
Part of https://github.com/servo/servo/issues/6041

Source-Repo: https://github.com/servo/servo
Source-Revision: 542519ebfd073662bc9421ac5fa0aa01ebc0d6fe
2015-05-24 18:27:26 -05:00
Ms2ger
30431efd3c servo: Merge #6044 - Various cleanup (from Ms2ger:cleanup); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 7bda431e61d06113306c3f12d9f4240a58a7d34d
2015-05-14 07:16:42 -05:00
Duncan
1dc5e8a7dc servo: Merge #5942 - Suggest how to fix unstable WHATWG links in tidy.py (from duncankl:whatwg-link-suggest); r=jdm
Simplified the checking logic a bit too; only a single match per line and a stricter regex that matches everything in one go.

I tested this against commit 8b08c6f4 and made sure it caught the same problems. Note that tidy doesn't currently check the webidls, so those would have still made it through.

Source-Repo: https://github.com/servo/servo
Source-Revision: 387836c42e2377fc53d51d3404e6b91d170727a8
2015-05-06 05:25:28 -05:00
Dhananjay Nakrani
e546a3eefc servo: Merge #5747 - [Issue#5730] Make tidy.py check for links to spec pages (from dhananjay92:Issue#5730); r=jdm
This PR does two things.
* Solve Issue #5730
* Refactor `tidy.py` to reduce code duplication.

Source-Repo: https://github.com/servo/servo
Source-Revision: d654eada6f583871bdceade6506631b6b39ebad0
2015-04-21 12:59:39 -05:00
Simon Sapin
457ec2ede7 servo: Merge #5574 - Move unit tests to their own crates, cut time by 96% (from servo:unit-tests); r=jack
On my laptop, running `./mach test-unit` goes from about 11 minutes to 22 seconds, when run after `./mach build`.

Fix #5291.

Source-Repo: https://github.com/servo/servo
Source-Revision: 017d1053617f6769d7f355e4a97d52ae67e53d1c
2015-04-07 21:16:49 -05:00
Prabhjyot Singh Sodhi
4cd50717da servo: Merge #5039 - Make Tidy check ports/cef and ports/glutin (from psdh:tidy); r=jdm
Fixes #5034

Source-Repo: https://github.com/servo/servo
Source-Revision: 9f3493b5bbfc6f0c40385fb41a32e006092e0f3a
2015-03-31 12:42:56 -06:00
Simon Sapin
2eeb47d83f servo: Merge #5172 - Organize reftest list alphabetically and make the tidy script check it (from servo:alpha); r=SimonSapin
Rebase of #5123. (Fixes #5123.) Thanks @gille-leblanc!

Reftest list check is checked using Python's default string comparison.
Also added a notice in the tidy script when there are no errors.

Fixes #5092

Source-Repo: https://github.com/servo/servo
Source-Revision: 3b14df16c6d60fd5e379203d8035e933777e0221
2015-03-07 10:48:51 -07:00
Manish Goregaokar
f267c73788 servo: Merge #5033 - Fix gonk warnings, add to tidy (from Manishearth:gonk-warn); r=Ms2ger
Rust still reports that the `*mut ANativeWindow` argument in `gnw_perform` in `gonk/src/window.rs` is ffi unsafe,
however `ANativeWindow` is marked as `#[repr(C)]` and should be okay.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8bc4d07e50aa38371ef383b8f22ec9f7cacaae96
2015-02-28 14:09:48 -07:00
Ms2ger
f59ae9c05a servo: Merge #4662 - Disallow lines that span more than 160 columns (from Ms2ger:overlong); r=larsbergstrom
The Rust style guide suggests 100, but we have too many violations in the
tree already. This check can be tightened over time.

Source-Repo: https://github.com/servo/servo
Source-Revision: ee94b3e8bf659c847bda967700272f8f98fdb0cc
2015-01-19 08:33:48 -07:00
Ms2ger
b3c7f9d2ca servo: Merge #4554 - Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19 (from servo:rustup_20141221); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 1d7148c79f9124779a910fd5291c5fa0543b2dae
2015-01-08 08:00:57 -07:00
Manish Goregaokar
b0d21c9484 servo: Merge #4240 - Make tidy ingore new target dir (from Manishearth:tidy); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: a451a3bdb5bd37dc671dcb24b80f869ad6a82010
2014-12-05 00:49:10 -07:00
Duncan Keall
03c75d8dc3 servo: Merge #3263 - Refactor python/tidy.py (updated post-cargoify) (from duncankl:refactor-test-tidy)
Source-Repo: https://github.com/servo/servo
Source-Revision: 3924652aa3d43fc10917e46cbb1a955bd0495614
2014-09-09 22:46:34 -06:00
Jack Moffitt
132ee35633 servo: Merge #3230 - Cargoify servo (from servo:cargoify)
Source-Repo: https://github.com/servo/servo
Source-Revision: b1305bb7d051f83850c51bb0da0ccc86a5e07922
2014-09-09 08:18:18 -06:00