Commit graph

81 commits

Author SHA1 Message Date
Bogdan Cuza
f039827dcd Fix #6664 and add color to tidy output 2015-07-28 13:28:33 +02:00
Corey Farwell
9e5f31ce00 Cleanup lint special cases, refactor flake8 linting
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
2015-07-26 22:12:20 +07:00
Corey Farwell
d71d2da81f Remove unused Python import 2015-07-26 22:07:22 +07:00
Michael Howell
ce4709d6a7 Remove the last few TRs. 2015-07-22 10:52:04 -07:00
Michael Howell
970f018dc8 Better references. 2015-07-22 10:49:26 -07:00
Michael Howell
91c61ae751 Tidy finds WebIDLs with no spec.
Closes #6689
2015-07-21 15:36:33 -07:00
Bogdan Cuza
75e14e80cd Fix #6623 and update toml.py 2015-07-20 19:47:35 +03:00
Corey Farwell
0ec2375cab Remove tidy blacklist for 'script/dom/bindings/*'
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.
2015-07-09 19:42:31 +09:00
Jack Moffitt
a0237085c6 Use Cargo's target directory sharing.
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.
2015-06-15 11:48:47 -06:00
Corey Farwell
848c57653c Add flake8 to the tidy process for Python files
Fixes #6236

Also included in this commit are the changes need to make flake8 pass
for the existing python file
2015-06-04 11:17:34 -04:00
Corey Farwell
6c8c039409 Run tidy everything in the tree, remove directory whitelist
After #6268 merged, I found out that everything in the tree currently
passes the tidy checker.
2015-06-03 12:03:13 -04:00
Corey Farwell
e3b71c65bf Fix tidy issues with Python files in python/ 2015-06-02 19:51:41 -04:00
Corey Farwell
c639a0cf49 Tidy files in the python/ directory 2015-06-02 19:30:44 -04:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
Ms2ger
d84c3e7a30 Fix some overlong lines. 2015-05-14 13:26:13 +02:00
Duncan
007295de4a Suggest how to fix unstable WHATWG links in tidy.py
Fixes #5929
2015-05-05 19:37:27 +12:00
Dhananjay Nakrani
030580e720 Rename check_whitespace_url_len() -> check_by_line(). 2015-04-21 10:20:13 -07:00
Dhananjay Nakrani
7453959426 Refactor tidy.py to reduce code duplication. 2015-04-21 10:20:12 -07:00
Dhananjay Nakrani
a0295b7489 Make tidy.py check for links to spec pages. [Issue#5730] 2015-04-21 10:20:11 -07:00
Simon Sapin
2a6f2cde50 Check license headers in ./tests 2015-04-08 01:07:56 +02:00
bors-servo
9f3493b5bb auto merge of #5039 : psdh/servo/tidy, r=jdm
Fixes #5034
2015-03-31 12:42:56 -06:00
Prabhjyot Singh Sodhi
2fdc1cbaa8 Making tidy.py check ports/glutin and ports/gonk 2015-03-31 16:37:30 +05:30
Gilles Leblanc
54dfb659ec Organize reftest list alphabetically and make the tidy script check it
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
2015-03-07 17:51:17 +01:00
Manish Goregaokar
d715241085 Test gonk in tidy 2015-02-23 21:19:35 +05:30
Ms2ger
394f816343 Disallow lines that span more than 160 columns.
The Rust style guide suggests 100, but we have too many violations in the
tree already. This check can be tightened over time.
2015-01-19 13:48:32 +01:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Manish Goregaokar
f6b6687e53 Make tidy ingore new target dir 2014-12-04 22:21:42 -08:00
Duncan Keall
74cc288cdb Use os.path.join instead of manually inserting slashes. 2014-09-10 11:03:21 +12:00
Duncan Keall
8e25e958ab Cleaned up python/licenseck.py
- Moved logic into tidy.py
- Removed explicit BSD license exceptions, they are already ignored by
  being inside the codegen directory.
2014-09-10 10:01:46 +12:00
Duncan Keall
6c48066565 Refactor python/tidy.py to not use globals. Fixes #3242 2014-09-10 10:01:46 +12:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/etc/tidy.py (Browse further)