Removes all those messy FooCast structures in InheritTypes.rs.
Source-Repo: https://github.com/servo/servo
Source-Revision: 674589c370d978f543e71f995d58c5b28e6e9842
Flags links to the single-page WHATWG specification and suggests the URL
for the multi page one.
Fixes#7998
Source-Repo: https://github.com/servo/servo
Source-Revision: 36998cd5b1ab8da63b6ec82c7d45b5dc08b5d42a
We don't need regex matching since ": &Vec<" doesn't
contain any special character.
New code reads better.
Fixes#7914.
Source-Repo: https://github.com/servo/servo
Source-Revision: 1192efed505ca19a395f22cd5e5733e8c57a6e82
This is a follow up of issue : Tidy has an off-by-one error #7686
It allows to raise the max length error when line is over than 120 not at 120 specifically.
Thanks for looking into it.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8f1469eb08a437bcc6cfb510334be2b6430b4a8f
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
Source-Repo: https://github.com/servo/servo
Source-Revision: 842112c0f39542a4fb120ade4afad302221609d8
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.
Source-Repo: https://github.com/servo/servo
Source-Revision: b1f0357fcee0b05bee79399bc96ea327b8b8dac8
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
This reverts commit c315404db80c92a695531b0aa4bcf61c125a3bff, reversing
changes made to b00583bd4e7169a6b952633df718268904f2bd0c.
Source-Repo: https://github.com/servo/servo
Source-Revision: 47d6d958f58f5011742a18abcdd5a76bf4390966
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
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
This checks every .toml file for an asterisk and prints an error if found.
Source-Repo: https://github.com/servo/servo
Source-Revision: 58e9bc6583b6ebbeb27e3b28a6b271ee48cd695a
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
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
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
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
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
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
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
--HG--
rename : servo/components/net/test.jpeg => servo/tests/unit/net/test.jpeg
rename : servo/components/script/tests.rs => servo/tests/unit/script/size_of.rs
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
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