Commit graph

66 commits

Author SHA1 Message Date
Pavel Sergeev
c225847a81 tidy: add extra space after keyword check 2017-07-20 00:44:59 +03:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Alan Jeffrey
1270080538 Count number of braces on a line in . 2017-06-07 14:25:07 -05:00
coalman
57e74542ee Make tidy check that opening and closing braces that begin a line do so with proper alignment. 2017-04-18 14:56:03 -04:00
강동윤
52ac3cf171 Allow using servo as dependency, by fixing Cargo.toml of servo-test-tidy. 2017-03-27 22:32:12 +09:00
lucantrop
b1faaa15dc added tidy check for -> () 2017-03-13 17:38:32 +01:00
UK992
7e348fa2a1 Fix Cargo.toml in servo_tidy_tests 2017-02-27 17:02:21 +01:00
Jefry Lagrange
ebcb15d6f2 Rewrite the ban-type lint in Python
Delete old rust ban lint and move tests to python tidy

Fix ban lint regex and fix test
2017-02-25 15:56:06 +01:00
vwvww
ccb14abd12 Add 'use statements with extraneous spaces' tidy check
Add 'use statements with extraneous spaces' tidy check

I added simple check routine for 'use statements with extraneous
spaces' and codes that breaks the check routine in rust_tidy.rs.

* Added a code that using 'use statements with extraneous spaces' code
  in rust_tidy.rs
* Added assertion code in test_tidy.py.
* check_rust function in tidy.py now recognizes the simple case in
  the 'use statements with extraneous spaces'.
* Ran tidy check on rust code and modified a
  code(tests/unit/style/parsing/inherited_text.rs) that is not passing
  on this new tidy check.

TODO: this code has to be refactored to support more general cases.

- [X] ./mach test-tidy does not report any errors
- [X] These changes fix #14898 (github issue number if applicable).
2017-02-23 01:29:46 +09:00
UK992
8a1aa354d6 Tidy: Report invalid listed ignored directories and files 2017-01-18 21:51:56 +01:00
Matthias Devlamynck
a7a2efea5c Moved tidy's BLOCKED_PACKAGES to the config file 2017-01-14 14:07:46 +01:00
Jure Podgoršek
adcedd8314 Rust tidy: disallow assignment = in the beginning of line 2017-01-06 20:56:59 +01:00
UK992
b760578f0f Tidy: Check Cargo.lock for packages with same version and different sources 2016-12-26 16:49:08 +01:00
Josh Matthews
14d8ae2478 Add a tidy check for problematic match cases in script_thread.rs 2016-12-16 11:52:45 -05:00
bors-servo
21ad1c2109 Auto merge of #14051 - birryree:tidy-check-buildbot-steps, r=aneeshusa
Adding linting checks for buildbot_steps.yml

This pull request adds some tidy checks around YAML files, and specifically `buildbot_steps.yml`.

Tidy checks added:

* YAML files are checked for well-formedness/parse-ability
* Whether a YAML file has duplicate keys
* Whether a `buildbot_steps.yml` file contains only mappings to list-of-strings.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] These changes fix #13838 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

…ing checking for correct mappings and duplicate YAML keys. Added unit tests to test_tidy.py.

<!-- Reviewable:start -->

---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14051)
<!-- Reviewable:end -->
2016-12-08 17:39:44 -08:00
William Lee
aceb60ec1d Add tidy linting checks for buildbot_steps.yml
This commit adds tidy checks for buildbot_steps.yml, as well as unit
tests. These checks include:

* Checking buildbot_steps.yml can be parsed by a YAML loader
* buildbot_steps.yml does not contain duplicate keys
* buildbot_steps.yml keys map to a list of strings
2016-12-08 20:36:13 -05:00
Ravi Shankar
34955e0bf8 Add tests for the new LintRunner 2016-11-11 19:54:34 +05:30
Ravi Shankar
f214765b61 Move file list iterator to a new module 2016-11-10 18:56:51 +05:30
Yuki Izumi
d47aca18c4
Check for JSON key non-duplication and order 2016-11-07 19:02:22 +11:00
bors-servo
291f393723 Auto merge of #13986 - iamrohit7:tidy-feature-attrs, r=Wafflespeanut
Make test-tidy check for alphabetical ordering of #![feature(...)] statements

<!-- Please describe your changes on the following line: -->

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] These changes fix #13954  (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---

This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13986)

<!-- Reviewable:end -->
2016-11-01 01:13:35 -05:00
Rohit Burra
c4cb3f345b Tests alphabetical ordering of #![feature(...)] 2016-11-01 11:35:39 +05:30
Daan Sprenkels
179e11ad8d test-tidy: Check for space between function name and (
Disallow an extraneous space in a function call between
the function name and the opening parenthesis in Rust
code, while ignoring macro declarations.

This commit fixes #13980.
2016-10-31 18:11:35 +01:00
bors-servo
3a5fd8b49a Auto merge of #13447 - gterzian:check_webidls_folder_files, r=Wafflespeanut
Have tidy ensure that the there are no extra files in the webidls folder #13427

<!-- Please describe your changes on the following line: -->
 Have tidy ensure that the there are no extra files in the webidls folder #13427

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13427 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13447)
<!-- Reviewable:end -->
2016-10-02 12:00:36 -05:00
Gregory
1f99381720 tidy: checking directories for unexpected file extensions
update config, check_dir func to use config

pass only_changed_files and exclude_dirs as args

simplify config

better conditional

remove unused default, amend error message

undo doc change
2016-10-02 14:40:28 +08:00
Matt Schmoyer
4846be1fdb using word license in test name for consistency 2016-10-01 12:25:57 -04:00
Hugo Thiessard
0ac212afb1 Issue #13350 Report tidy error for space after ( 2016-09-23 14:01:58 +02:00
UK992
875981ece5 Fix ordering use statements with braces 2016-09-09 04:42:30 +02:00
UK992
d5b76c9f6d Tidy: Handle empty files 2016-08-29 18:33:03 +02:00
UK992
0f07517049 Check for license only in Cargo.toml 2016-08-25 06:50:23 +02:00
Ravi Shankar
33d7b3967e Some cleanups in tidy 2016-08-23 00:53:09 +05:30
UK992
74dba5cbdd Check for errors in tidy config file 2016-08-20 22:51:46 +02:00
UK992
9a3b61abe1 Check for blank line after shebang and grab actual comment block instead of hard-coded one 2016-08-12 13:34:38 +02:00
edunham
48ace17b54 Improve tidy's license validation logic
fixes https://github.com/servo/servo/issues/10716

I took the lazy way out and hardcoded the size of block we examine for
licenses.

fixes https://github.com/servo/servo/issues/10719

Includes tests for new functionality.
2016-08-12 13:32:09 +02:00
Aneesh Agrawal
f07d8f188a Add lint for [ instead of [[ in shells scripts 2016-08-05 09:42:04 -04:00
Aneesh Agrawal
9231ca1c69 Add lint to ensure substitutions use the full form
Check that any variable substitutions use the full ${VAR} form,
not just $VAR (but don't check for quoting yet).
2016-08-05 09:29:10 -04:00
Aneesh Agrawal
79ef9b4efc Add lint for backticks in shell scripts
The "$(some_command arg1 arg2)" form is preferred to the
`some_command arg1 arg2` form because it nests unambiguously.
Add a lint for this to tidy.
2016-08-05 09:29:09 -04:00
bors-servo
4bc629b369 Auto merge of #12295 - jimberlage:12158/shell-linting, r=aneeshusa
Add linting for shell scripts

<!-- Please describe your changes on the following line: -->

This changes tidy to check shell scripts for the proper shebang and
options.  It does not check that variables are formatted correctly.  It
also adds a check for the MPL 2.0 license in shell scripts.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12158 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12295)
<!-- Reviewable:end -->
2016-08-04 12:31:17 -05:00
bors-servo
81a1e28da1 Auto merge of #12567 - servo:tidy-self-test-result, r=jdm
Return failure if the tidy self-tests fail.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12567)
<!-- Reviewable:end -->
2016-07-24 02:51:25 -05:00
Ms2ger
3548b5edd0 Return failure if the tidy self-tests fail. 2016-07-23 15:29:06 +02:00
Simon Martin
c35cf9ad8a Issue #12564: Fix "./mach test-tidy --self-test". 2016-07-23 14:41:48 +02:00
Jim Berlage
7952bd00b6 Add linting for shell scripts
This changes tidy to check shell scripts for the proper shebang and
options.  It does not check that variables are formatted correctly.  It
also adds a check for the MPL 2.0 license in shell scripts.
2016-07-22 11:53:14 -05:00
Owen Coutts
ff4cb7f80a [tidy] check for duplicate keys in .json files 2016-07-08 11:12:12 +02:00
bors-servo
34e53b1dca Auto merge of #12317 - tallowen:add-tidy-test, r=jdm
[tidy] Test json parsing functionality

We didn't have a test for json parsing so lets start with that

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12317)
<!-- Reviewable:end -->
2016-07-07 20:12:38 -07:00
Owen Coutts
28399d0877 [tidy] Add test for existing json functionality 2016-07-07 17:07:03 +02:00
Nikhil Shagrithaya
6c6bfdb523 Added a subdirectory with a file to test whether tidy command ignores files in subdirectories 2016-07-07 15:08:41 +05:30
Travis Dean
6642358217 Add style check, test, and code fixes for an else brace check. 2016-07-04 18:38:13 -04:00
Ravi Shankar
5c1f8924c4 Tidy test for ignoring attributes 2016-06-16 23:43:49 +05:30
Ravi Shankar
dfe32b0ada Removed unused function and minor cleanup 2016-06-16 00:07:21 +05:30
bors-servo
bc2f4c3450 Auto merge of #11621 - h4xr:mach_fix, r=Wafflespeanut
Make mach test-tidy consider ignored dirs

Made changes so that mach test-tidy considers the ignored directories

Fixes #11386

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11621)
<!-- Reviewable:end -->
2016-06-14 23:33:52 -05:00