aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
Commit message (Collapse)AuthorAgeFilesLines
* Auto merge of #7438 - Wafflespeanut:cargo-tidy, r=jdmbors-servo2015-09-011-3/+43
|\ | | | | | | | | | | | | | | | | | | Tidy can now check for version conflicts... fixes #7133 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7438) <!-- Reviewable:end -->
| * Tidy could now check for version conflicts!Ravi Shankar2015-09-021-3/+43
| |
* | Auto merge of #7468 - JoshTheGoldfish:Issue7460, r=jdmbors-servo2015-09-011-18/+34
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Making test-tidy check that = have space after them For issue #7460. Need to ensure compatibility with #7390. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7468) <!-- Reviewable:end -->
| * | make test-tidy check that = have space after themerneyja2015-09-011-18/+34
| |/
* | Enforce linking to spec for method implementations via macrosCorey Farwell2015-08-311-3/+20
| |
* | Auto merge of #7478 - frewsxcv:spec-link-tidy-fix, r=jdmbors-servo2015-08-311-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Update spec link pattern to reflect `impl` signature changes Relevant to #7416 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7478) <!-- Reviewable:end -->
| * | Update spec link pattern to reflect `impl` signature changesCorey Farwell2015-08-311-1/+1
| |/ | | | | | | Relevant to #7416
* / Make test-tidy check that braces have spaces before or after themwilmoz2015-08-311-0/+10
|/
* tidy will now show its expectation of usesRavi Shankar2015-08-281-1/+4
|
* Forbid multiline importswilmoz2015-08-251-2/+1
|
* Make tidy search for files recursively againCorey Farwell2015-08-241-16/+16
| | | | | | | | In #7348 `os.walk` was replaced with `os.listdir`. The latter is not recursive, which results in only the root directory files getting linted The changes to `ignored_files` are needed because calling `os.walk(".")` results in `./` getting prefixed before each path
* update tidy.py remove collect_file_names:João Oliveira2015-08-251-14/+4
| | | | call python os functions inline
* Auto merge of #7118 - g-k:tidy-check-unused-html-files, r=jdmbors-servo2015-08-241-3/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tidy check for unused reftest html files Refs: https://github.com/servo/servo/issues/7078 Sample output: ``` $ time ./mach test-tidy tests/ref/background_image_a.html not used or commented out in basic.list tests/ref/background_image_ref.html not used or commented out in basic.list tests/ref/canvas_linear_gradient_a.html not used or commented out in basic.list tests/ref/canvas_linear_gradient_ref.html not used or commented out in basic.list tests/ref/canvas_radial_gradient_a.html not used or commented out in basic.list tests/ref/canvas_radial_gradient_ref.html not used or commented out in basic.list tests/ref/inline_border_a.html not used or commented out in basic.list tests/ref/inline_border_b.html not used or commented out in basic.list tests/ref/inline_text_align_a.html not used or commented out in basic.list tests/ref/inline_text_align_b.html not used or commented out in basic.list tests/ref/link_style_dynamic_addition.html not used or commented out in basic.list tests/ref/link_style_dynamic_addition_ref.html not used or commented out in basic.list tests/ref/overflow_position_abs_inside_normal_a.html not used or commented out in basic.list tests/ref/overflow_position_abs_inside_normal_b.html not used or commented out in basic.list tests/ref/overflow_position_abs_simple_a.html not used or commented out in basic.list tests/ref/overflow_position_abs_simple_b.html not used or commented out in basic.list tests/ref/position_fixed_a.html not used or commented out in basic.list tests/ref/position_fixed_b.html not used or commented out in basic.list tests/ref/position_fixed_simple_a.html not used or commented out in basic.list tests/ref/position_fixed_simple_b.html not used or commented out in basic.list tests/ref/position_fixed_static_y_a.html not used or commented out in basic.list tests/ref/position_fixed_static_y_b.html not used or commented out in basic.list tests/ref/style_is_in_doc.html not used or commented out in basic.list tests/ref/style_is_in_doc_ref.html not used or commented out in basic.list tests/ref/table_specified_width_a.html not used or commented out in basic.list tests/ref/table_specified_width_ref.html not used or commented out in basic.list tests/ref/text_decoration_propagation_a.html not used or commented out in basic.list tests/ref/text_decoration_propagation_b.html not used or commented out in basic.list tests/ref/text_shadow_multiple_shadows_a.html not used or commented out in basic.list tests/ref/text_shadow_multiple_shadows_ref.html not used or commented out in basic.list tests/ref/viewport_percentage_vmin_vmax_b.html not used or commented out in basic.list tests/ref/viewport_percentage_vw_vh_b.html not used or commented out in basic.list tests/ref/white_space_intrinsic_sizes_a.html not used or commented out in basic.list tests/ref/white_space_intrinsic_sizes_ref.html not used or commented out in basic.list tests/ref/fonts/takao-p-gothic/COPYING.html not used or commented out in basic.list tests/ref/iframe/multiple_external_child.html not used or commented out in basic.list ... ``` I thought it might be helpful to say which files aren't used in `basic.list`. `./mach test-tidy` is a second or two slower on my laptop. Not sure if this counts as a warning or an error that should return 1. Not sure whether unused file output should go before or after the line specific errors. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7118) <!-- Reviewable:end -->
| * Add tidy check for unused reftest html filesGreg Guthe2015-08-191-3/+21
| | | | | | | | Refs: https://github.com/servo/servo/issues/7078
* | Mention max length in tidy check_length. Fixes #7309OneKorg2015-08-211-2/+3
| |
* | check for uses to be sortedJohann Tuffe2015-08-201-2/+16
|/
* Deal with /* /* when checking syntax.Josh Matthews2015-08-161-8/+7
|
* Tighten up checks for spaces around colons to deal with trait inheritance ↵Josh Matthews2015-08-161-3/+5
| | | | syntax.
* Deal with multiline comments and reduce false positives for common syntax ↵Josh Matthews2015-08-161-10/+41
| | | | overlaps. Improve error messages.
* Deal with multiline strings and tighten up syntax nit error messages.Josh Matthews2015-08-161-19/+25
|
* Check for simple Rust style nits in tidy.pywilmoz2015-08-161-1/+51
|
* Revert "Auto merge of #7103 - frewsxcv:python-venv, r=metajack" for breaking ↵Ms2ger2015-08-091-1/+8
| | | | | | | web-platform-tests. This reverts commit c315404db80c92a695531b0aa4bcf61c125a3bff, reversing changes made to b00583bd4e7169a6b952633df718268904f2bd0c.
* Use one Python virtual environment for all mach commandsCorey Farwell2015-08-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit: * Our Python dependency story was a bit of a mess. We had complete Python packages (wheels and directories) living in-tree, despite not having any changes from upstream. This is particularly bad because `setup.py` never gets run on these packages which could (sometimes silently) unintended breakage. * Python virtual environments (virtualenv) were only utilized for testing web-platform tests After this commit: * A single virtualenv (`python/_virtualenv`) is activated upon *every* call to mach * A requirements file (`python/requirements.txt`) is added to describe the dependencies needed by Python modules in `python/`. The child commit immediately following this will remove all the dependencies no longer needed in-tree (for the sake of keeping this commit readable). Relevant to https://github.com/servo/servo/issues/861 Fixes https://github.com/servo/servo/issues/6999
* Remove unused variableCorey Farwell2015-08-081-1/+0
|
* Remove invalid file path in ignored_files for tidyingCorey Farwell2015-08-071-1/+0
|
* Prevent flake8 from crashing tidyCorey Farwell2015-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Implement the FileList interface. Fixes #6708Bogdan Cuza2015-08-011-0/+1
|
* Fix #6664 and add color to tidy outputBogdan Cuza2015-07-281-3/+31
|
* Cleanup lint special cases, refactor flake8 lintingCorey Farwell2015-07-261-31/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unused Python importCorey Farwell2015-07-261-1/+0
|
* Remove the last few TRs.Michael Howell2015-07-221-1/+0
|
* Better references.Michael Howell2015-07-221-2/+0
|
* Tidy finds WebIDLs with no spec.Michael Howell2015-07-211-1/+51
| | | | Closes #6689
* Fix #6623 and update toml.pyBogdan Cuza2015-07-201-4/+16
|
* Remove tidy blacklist for 'script/dom/bindings/*'Corey Farwell2015-07-091-1/+8
| | | | | | | | | | | | | | | | | | | | | 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 '# noqa' comment which tells us to ignore the flake8 errors for that line. I chose to ignore this (instead of fixing it) to make the work for this commit simpler for me.
* Use Cargo's target directory sharing.Jack Moffitt2015-06-151-2/+1
| | | | | This speeds up `./mach build --dev` followed by `./mach build-cef` by a large amount, and also speeds up other build combos found in our CI.
* Add flake8 to the tidy process for Python filesCorey Farwell2015-06-041-4/+34
| | | | | | | Fixes #6236 Also included in this commit are the changes need to make flake8 pass for the existing python file
* Run tidy everything in the tree, remove directory whitelistCorey Farwell2015-06-031-3/+7
| | | | | After #6268 merged, I found out that everything in the tree currently passes the tidy checker.
* Fix tidy issues with Python files in python/Corey Farwell2015-06-021-1/+6
|
* Tidy files in the `python/` directoryCorey Farwell2015-06-021-1/+6
|
* Reduce max line length from 150 to 120 charactersCorey Farwell2015-05-241-1/+1
| | | | Part of https://github.com/servo/servo/issues/6041
* Fix some overlong lines.Ms2ger2015-05-141-1/+1
|
* Suggest how to fix unstable WHATWG links in tidy.pyDuncan2015-05-051-6/+4
| | | | Fixes #5929
* Rename check_whitespace_url_len() -> check_by_line().Dhananjay Nakrani2015-04-211-2/+2
|
* Refactor tidy.py to reduce code duplication.Dhananjay Nakrani2015-04-211-29/+29
|
* Make tidy.py check for links to spec pages. [Issue#5730]Dhananjay Nakrani2015-04-211-1/+11
|
* Check license headers in ./testsSimon Sapin2015-04-081-2/+2
|
* auto merge of #5039 : psdh/servo/tidy, r=jdmbors-servo2015-03-311-1/+2
|\ | | | | | | Fixes #5034
| * Making tidy.py check ports/glutin and ports/gonkPrabhjyot Singh Sodhi2015-03-311-1/+2
| |
* | Organize reftest list alphabetically and make the tidy script check itGilles Leblanc2015-03-071-1/+36
|/ | | | | | | 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