Command-line client?

113 views
Skip to first unread message

briandoll

unread,
Jun 22, 2011, 2:29:57 PM6/22/11
to CSS Lint
OOCSS is awesome and led me to finally grok how CSS should be done.
CSSLint is awesome because we all make mistakes and these types of
tools are always insanely helpful.

I'm a big fan of command-line tools, though, and I was curious if
other folks would enjoy a command-line interface to CSSLint? Since
the development of CSSLint targets a web interface, I'm considering
writing a tool that would use the CSSLint website under the covers,
rather than trying to package up the guts of CSSLint and using it
directly.

I know how I'd like this to work, but I'm looking for some feedback
before working on it. Would you find a command-line interface useful?

Nicholas Zakas

unread,
Jun 22, 2011, 2:40:03 PM6/22/11
to CSS Lint
Hi Brian,

There are already two command line clients available: one that works
with Node.js and one that works with Rhino. We're a bit behind on
documenting these. If you're using Node.js and npm, you can do this to
install:

npm install -g csslint

Then you can run via:

csslint your.css another.css

If you'd like to use Rhino, go and download the latest JAR file from
http://www.mozilla.org/rhino/. In the CSS lint build directory,
there's a file called csslint-rhino.js. Grab that, and then you can
run this on the command line:

java -jar rhino.jar csslint-rhino.js your.css another.css

Hope this helps.

-N

briandoll

unread,
Jun 22, 2011, 2:54:01 PM6/22/11
to CSS Lint
Great to hear, and glad I asked before building one :)

This just might be the final straw to finally install Node.js ;)

Eric Wendelin

unread,
Jun 22, 2011, 4:16:05 PM6/22/11
to css-...@googlegroups.com
@Brian: 
Looks like the node cli will hopefully get some love for 0.3.0, which is good because it doesn't seem to be working for at least a few of us on Mac or *nix. Note that this is also only a problem if you get csslint from npm (as far as I've seen).

@Nicolas:
+1 on this feature and great work on the tool. I'm integrating csslint with my Jenkins CI and will have to write a patch to produce JSLint-compatible XML for reporting if one hasn't been made already.

Cheers,
Eric

Objelean Alex

unread,
Jun 22, 2011, 4:21:31 PM6/22/11
to css-...@googlegroups.com
There is also another command line tool, called wro4j-runner, which now supports css lint: 
The latest version of wro4j-runner (1.3.8 which was released today) provide support for css lint. 
Also, the new release of wro4j provides support for css lint as a maven plugin. 

The documentation is not up to date, but it will be updated very soon.

Regards,
Alex

Shinuza

unread,
Jun 22, 2011, 5:19:18 PM6/22/11
to CSS Lint
You can clone CSSLint from github.com, cd to build/npm and run npm
install -g in there.
You can also dos2unix the cli.js file that npm installs if you can
locate it.

The version currently in the repo should be published to npm this
week end.

Objelean Alex

unread,
Jun 23, 2011, 7:38:42 AM6/23/11
to css-...@googlegroups.com
Now documentation is up to date about wro4j-runner: http://code.google.com/p/wro4j/wiki/wro4jRunner

Using cssLint is as simple as: 

java -jar wro4j-runner-1.3.8.1-jar-with-dependencies.jar -m -c cssLint
Regards,
Alex
Reply all
Reply to author
Forward
0 new messages