Add CSS coding convention checker
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pocket-lint |
Fix Released
|
High
|
Adi Roiban |
Bug Description
Like we have PEP8 it would be nice to have a similar coding convention checker for CSS.
cssutils only checks for valid property names and values and does not report formating / coding conventions changes.
I have wrote a CSS coding convention checker to be use for my projects and I was thinking that maybe you would like to have something like this in pocket-lint.
It is based on the CSS coding conventions described on this page : http://
It includes support for both ways of opening CSS blocks:
selector,
selector2
{
property: value;
}
selector,
selector2 {
property: value;
}
-----
There are still things that could be improved but for the moment it works for me as it is.
If there is interest and feedback I could improve the code so that it can be useful for others.
-----
I will attach my branch to this bug.
Cheers
Related branches
- Curtis Hovey: Approve (code)
-
Diff: 1103 lines (+1040/-4)4 files modifiedpocketlint/contrib/cssccc.py (+492/-0)
pocketlint/formatcheck.py (+17/-2)
pocketlint/tests/test_css.py (+2/-2)
pocketlint/tests/test_cssccc.py (+529/-0)
description: | updated |
Changed in pocket-lint: | |
milestone: | none → 0.5.15 |
Changed in pocket-lint: | |
status: | Triaged → Fix Committed |
Changed in pocket-lint: | |
status: | Fix Committed → Fix Released |
Thanks for linking to a branch.
I too pondered a CSS style checker. I am not happy with CSSUtils. It is slow and emphasises historic CSS instead of preparing CSS for modern usage. The formatter that gdp uses is more rigorous with indentation:
selector (
property-name: value;
}
But I neglected to move that formatter when I extracted the checking and formatting rules to pocketlint (See bug 601736).
I have proposed the branch for merging.