Closed
Bug 981610
Opened 11 years ago
Closed 10 years ago
Activate the CSS Linter as a pre-commit hook
Categories
(Firefox OS Graveyard :: Gaia, defect)
Firefox OS Graveyard
Gaia
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: vingtetun, Assigned: vingtetun)
References
Details
Attachments
(21 files, 3 obsolete files)
1.82 KB,
patch
|
iliu
:
review+
|
Details | Diff | Splinter Review |
849 bytes,
patch
|
benfrancis
:
review+
|
Details | Diff | Splinter Review |
3.37 KB,
patch
|
kgrandon
:
review+
|
Details | Diff | Splinter Review |
2.56 KB,
patch
|
wilsonpage
:
review+
|
Details | Diff | Splinter Review |
1.31 KB,
patch
|
mcav
:
review+
|
Details | Diff | Splinter Review |
3.08 KB,
patch
|
salva
:
review-
|
Details | Diff | Splinter Review |
1.92 KB,
patch
|
jrburke
:
review+
|
Details | Diff | Splinter Review |
344 bytes,
patch
|
djf
:
review+
|
Details | Diff | Splinter Review |
3.44 KB,
patch
|
djf
:
review+
|
Details | Diff | Splinter Review |
952 bytes,
patch
|
bdahl
:
review+
|
Details | Diff | Splinter Review |
4.58 KB,
patch
|
jj.evelyn
:
review+
|
Details | Diff | Splinter Review |
1.27 KB,
patch
|
steveck
:
review+
|
Details | Diff | Splinter Review |
3.86 KB,
patch
|
alive
:
review+
|
Details | Diff | Splinter Review |
4.15 KB,
text/css
|
djf
:
review+
|
Details |
1.83 KB,
patch
|
jmcf
:
review+
|
Details | Diff | Splinter Review |
2.03 KB,
patch
|
etienne
:
review+
|
Details | Diff | Splinter Review |
1.93 KB,
patch
|
arcturus
:
review+
|
Details | Diff | Splinter Review |
2.43 KB,
patch
|
ranbena
:
review+
|
Details | Diff | Splinter Review |
1.66 KB,
patch
|
janjongboom
:
review+
|
Details | Diff | Splinter Review |
11.90 KB,
patch
|
ochameau
:
review+
|
Details | Diff | Splinter Review |
3.14 KB,
patch
|
arnau
:
review+
|
Details | Diff | Splinter Review |
Would be nice to have it as a pre-commit hook. A system like the one which is used for jshint files that are failing would be nice too to turn it on. It would be better if this system can also have the number of errors/warnings in the file, and so people won't be able to add new one, but only to remove some.
Assignee | ||
Comment 1•11 years ago
|
||
At some points the linter should be activated as a pre-commit hook. In order to do so we will likely have to have a file to exclude some css files, but I hope we can reduce the list to a minimum.
So let's starts to land some css clean up into some bugs before finishing the pre-commit hook patch...
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8390486 -
Flags: review?(iliu)
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8390487 -
Flags: review?(bfrancis)
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8390490 -
Flags: review?(kgrandon)
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8390492 -
Flags: review?(wilsonpage)
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8390493 -
Flags: review?(m)
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #8390494 -
Flags: review?(salva)
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8390495 -
Flags: review?(jrburke)
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #8390496 -
Flags: review?(dflanagan)
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8390497 -
Flags: review?(dflanagan)
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #8390498 -
Flags: review?(crdlc)
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #8390499 -
Flags: review?(janjongboom)
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #8390500 -
Flags: review?(bdahl)
Assignee | ||
Comment 14•11 years ago
|
||
Attachment #8390501 -
Flags: review?(ehung)
Assignee | ||
Comment 15•11 years ago
|
||
Attachment #8390502 -
Flags: review?(schung)
Assignee | ||
Comment 16•11 years ago
|
||
Attachment #8390503 -
Flags: review?(alive)
Assignee | ||
Comment 17•11 years ago
|
||
Attachment #8390505 -
Flags: review?(dflanagan)
Assignee | ||
Comment 18•11 years ago
|
||
Those patches are just some small and safe (in theory) removals of some css warnings/errors.
There is still errors and warnings with those fixes, but a bit less. Asking reviews to you on some of those patches sounds also a simple and friendly way to make you know about the css linter :)
The idea is to be able to turn on the linter with as few ignored files as possible. The rules for the linter can be discussed as much as you want (for the moment i enabled only things that seems to make sense to me, but i have no strong opinions), but those fixes should be pretty straightforward imho.
If you want to run the linter yourself on the app, just do |APP=... make csslint| until the pre-commit hook lands.
Comment 19•11 years ago
|
||
Comment on attachment 8390498 [details] [diff] [review]
homescreen.warnings.patch
Sorry Vivien, attach the patch, I think that it is just a log :)
Attachment #8390498 -
Flags: review?(crdlc) → review-
Updated•11 years ago
|
Attachment #8390492 -
Flags: review?(wilsonpage) → review+
Updated•11 years ago
|
Attachment #8390490 -
Flags: review?(kgrandon) → review+
Assignee | ||
Comment 20•11 years ago
|
||
(In reply to Cristian Rodriguez (:crdlc) from comment #19)
> Comment on attachment 8390498 [details] [diff] [review]
> homescreen.warnings.patch
>
> Sorry Vivien, attach the patch, I think that it is just a log :)
oups :) I will attached the real patch!
Assignee | ||
Comment 21•11 years ago
|
||
Attachment #8390562 -
Flags: review?(jmcf)
Assignee | ||
Comment 22•11 years ago
|
||
Attachment #8390563 -
Flags: review?(etienne)
Assignee | ||
Comment 23•11 years ago
|
||
Attachment #8390564 -
Flags: review?(francisco.jordano)
Assignee | ||
Comment 24•11 years ago
|
||
Attachment #8390498 -
Attachment is obsolete: true
Attachment #8390566 -
Flags: review?(crdlc)
Updated•11 years ago
|
Attachment #8390502 -
Flags: review?(schung) → review+
Comment 25•11 years ago
|
||
Comment on attachment 8390566 [details] [diff] [review]
homescreen.warnings.patch
All changes are done in the ev.me code so I prefer that Ran will take a look to this better than me. Thx!
Attachment #8390566 -
Flags: review?(crdlc) → review?(ran)
Updated•11 years ago
|
Attachment #8390493 -
Flags: review?(m) → review+
Comment 26•11 years ago
|
||
Comment on attachment 8390562 [details] [diff] [review]
contacts.warnings.patch
Review of attachment 8390562 [details] [diff] [review]:
-----------------------------------------------------------------
thanks
Attachment #8390562 -
Flags: review?(jmcf) → review+
Updated•11 years ago
|
Attachment #8390487 -
Flags: review?(bfrancis) → review+
Updated•11 years ago
|
Attachment #8390495 -
Flags: review?(jrburke) → review+
Assignee | ||
Comment 27•11 years ago
|
||
Here is the pre-commit hook.
For the moment the list of exclusion is contains in build/csslint/xfail.list.
The file is still empty as I intend to populate it before landing as it does not really makes sense to do it right now. I also relaxed a bit the warnings part since have having played with the linter a bit I have some doubts that some of the rules are going to be fixed one day.
Assignee | ||
Updated•11 years ago
|
Attachment #8390954 -
Flags: review?(poirot.alex)
Updated•11 years ago
|
Attachment #8390503 -
Flags: review?(alive) → review+
Updated•11 years ago
|
Attachment #8390486 -
Flags: review?(iliu) → review+
Comment 28•11 years ago
|
||
Comment on attachment 8390563 [details] [diff] [review]
dialer.warnings.patch
Review of attachment 8390563 [details] [diff] [review]:
-----------------------------------------------------------------
impressive bug :)
Attachment #8390563 -
Flags: review?(etienne) → review+
Comment 29•11 years ago
|
||
Comment on attachment 8390564 [details] [diff] [review]
ftu.warnings.patch
Thanks Vivien!
Attachment #8390564 -
Flags: review?(francisco.jordano) → review+
Comment 30•11 years ago
|
||
Comment on attachment 8390496 [details] [diff] [review]
fl.warnings.patch
Review of attachment 8390496 [details] [diff] [review]:
-----------------------------------------------------------------
just removes an unused class. trivially correct.
Attachment #8390496 -
Flags: review?(dflanagan) → review+
Comment 31•11 years ago
|
||
Comment on attachment 8390497 [details] [diff] [review]
gallery.warnings.patch
trivially correct patch that just removes unneeded units from 0 values.
Attachment #8390497 -
Flags: review?(dflanagan) → review+
Comment 32•11 years ago
|
||
Comment on attachment 8390505 [details]
video.warnings.css
trivially correct patch that just removes units from zero values.
Attachment #8390505 -
Flags: review?(dflanagan) → review+
Comment 33•11 years ago
|
||
Comment on attachment 8390500 [details] [diff] [review]
pdfjs.warnings.patch
Review of attachment 8390500 [details] [diff] [review]:
-----------------------------------------------------------------
Upstreamed https://github.com/mozilla/pdf.js/pull/4454
Attachment #8390500 -
Flags: review?(bdahl) → review+
Comment 34•11 years ago
|
||
Comment on attachment 8390501 [details] [diff] [review]
settings.warnings.patch
thanks!
Attachment #8390501 -
Flags: review?(ehung) → review+
Comment 35•11 years ago
|
||
Comment on attachment 8390566 [details] [diff] [review]
homescreen.warnings.patch
Review of attachment 8390566 [details] [diff] [review]:
-----------------------------------------------------------------
Good catches! :)
Attachment #8390566 -
Flags: review?(ran) → review+
Assignee | ||
Comment 36•11 years ago
|
||
Just merged the css changes where I already got a r+ since all of them are atomic.
https://github.com/mozilla-b2g/gaia/commit/da62d798a8a7b9e4d24c40265e171756731d856a
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → 21
Whiteboard: [leave-open]
Comment 37•11 years ago
|
||
Comment on attachment 8390499 [details] [diff] [review]
keyboard.warnings.patch
+ margin: -0.6rem 0 0rem 0; /* I don't know why we need the top margin */
0rem -> should be 0
Attachment #8390499 -
Flags: review?(janjongboom) → review-
Assignee | ||
Comment 38•11 years ago
|
||
(In reply to Jan Jongboom [:janjongboom] from comment #37)
> Comment on attachment 8390499 [details] [diff] [review]
> keyboard.warnings.patch
>
> + margin: -0.6rem 0 0rem 0; /* I don't know why we need the top margin */
>
> 0rem -> should be 0
Good catch thanks.
Assignee | ||
Comment 39•11 years ago
|
||
Attachment #8390499 -
Attachment is obsolete: true
Attachment #8392218 -
Flags: review?(janjongboom)
Comment 40•11 years ago
|
||
Comment on attachment 8390954 [details] [diff] [review]
precommit.css.patch
Review of attachment 8390954 [details] [diff] [review]:
-----------------------------------------------------------------
Doesn't apply/work. Isn't there a missing patch?
::: tools/pre-commit
@@ +94,5 @@
> +
> +$XULRUNNER_SDK $XPCSHELL_SDK \
> + -e "const GAIA_BUILD_DIR='file://$(pwd)/build/'" \
> + -f build/xpcshell-commonjs.js \
> + -e "quit(require('csslint').lint('$(pwd)', '$changed_files'));"
What about calling a Makefile's target instead (like what we are doing with gjslint)?
It looks weird to pull Makefile variables with such special echo rule.
@@ +108,1 @@
> for file in $(git diff --staged --name-only); do
pre-commit doesn't apply, nor works as $changed_files only track .js files...
Also, even if I fixed that, I get some stange behavior:
$ git diff
diff --git a/apps/browser/style/settings.css b/apps/browser/style/settings.css
index 186fba6..db2d535 100644
--- a/apps/browser/style/settings.css
+++ b/apps/browser/style/settings.css
@@ -1,3 +1,4 @@
+
#settings ul {
margin: 0;
padding: 0;
alex@ubuntu:~/gaia$ git commit apps/browser/style/settings.css
apps/browser/style/settings.css
There were errors while linting the files, please see above.
We don't see any meaningfull error message.
Attachment #8390954 -
Flags: review?(poirot.alex) → review-
Assignee | ||
Comment 41•11 years ago
|
||
Not sure why you didn't see anything in the console.
I forgot to fix the changed_files stuff since I initially develop the pre-commit hook into a shell script.
I killed the build/xulrunner_config file but keep the command to call the linter in the pre-commit file as it seems that the Makefile is already huge and I prefer to keep the logic where it belongs.
I will walk and seat next to you to see if there is anything wrong and why nothing is showned on your console (if it still happens).
Attachment #8390954 -
Attachment is obsolete: true
Attachment #8392880 -
Flags: review?(poirot.alex)
Comment 42•11 years ago
|
||
Comment on attachment 8392880 [details] [diff] [review]
bug981610.precommit
Review of attachment 8392880 [details] [diff] [review]:
-----------------------------------------------------------------
Works great now!
That would be really great if you can move the xpcshell call in the Makefile so that we get a common place where we call it.
Attachment #8392880 -
Flags: review?(poirot.alex) → review+
Assignee | ||
Comment 43•11 years ago
|
||
Attachment #8393008 -
Flags: review?(arnau)
Assignee | ||
Comment 44•11 years ago
|
||
Just merged the linter: https://github.com/mozilla-b2g/gaia/commit/c250da9f8fdc511ad718ba594a0aa60a5959e74b
It makes me a bit stressed since if it's buggy it may be painful for people. If there is any issue, please don't hesitate to backout the changeset c250da9f8fdc511ad718ba594a0aa60a5959e74b and I will fix the issue before relanding.
Comment on attachment 8393008 [details] [diff] [review]
bug981610.shared.patch
Thanks Vivien, that will help us catching some errors!
Attachment #8393008 -
Flags: review?(arnau) → review+
Updated•11 years ago
|
Attachment #8392218 -
Flags: review?(janjongboom) → review+
Assignee | ||
Comment 46•11 years ago
|
||
Assignee | ||
Comment 47•11 years ago
|
||
shared patch: https://github.com/mozilla-b2g/gaia/commit/71df836011d1d116c94551c23ffce522ded958ae
I also realized that there was an issue with the shared/ folder beeing not taken correctly by the pre-commit hook, so I fixed that and land it as well.
Comment 48•11 years ago
|
||
Comment on attachment 8390494 [details] [diff] [review]
costcontrol.warnings.patch
Review of attachment 8390494 [details] [diff] [review]:
-----------------------------------------------------------------
The patch does not apply on master. Maybe something changed. Here in:
--- a/apps/costcontrol/style/views/firsttime.css
+++ a/apps/costcontrol/style/views/firsttime.css
@@ -1,1 +1,0 @@
- color: #fff;
color: #fff does not exist. But I found a dupllicated entry with color: #000 instead.
Attachment #8390494 -
Flags: review?(salva) → review-
Assignee | ||
Comment 49•11 years ago
|
||
Grrr. Someone backouted some of the patches with a bad merge backout..... Relanded: https://github.com/mozilla-b2g/gaia/commit/3478dc21f7a8a836a51ee0ee0f1ed1fed1a8255d
Comment 50•10 years ago
|
||
This is done, let's close.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [leave-open]
You need to log in
before you can comment on or make changes to this bug.
Description
•