Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow turning on/off rules #77

Closed
nzakas opened this issue Jun 19, 2011 · 6 comments
Closed

Allow turning on/off rules #77

nzakas opened this issue Jun 19, 2011 · 6 comments
Labels
Milestone

Comments

@nzakas
Copy link
Contributor

nzakas commented Jun 19, 2011

In both the Web UI and in the CLI, we need to allow people to turn on/off specific rules.

@hpbuniat
Copy link
Contributor

Could this be solved with #76?

@nzakas
Copy link
Contributor Author

nzakas commented Jun 19, 2011

#76 is a bit more than we need. The ability to turn on/off rules is already in the API, it just needs to be exposed.

@eitanmk
Copy link
Contributor

eitanmk commented Jun 19, 2011

Did you have a system similar to JSLint in mind for this?

For example, at the top of a file to be parsed:
/*csslint empty-rules: false, floats: false */

It can use the id property of each rule.

@nzakas
Copy link
Contributor Author

nzakas commented Jun 19, 2011

Yes, though the values need to be quoted if it has a dash

/*csslint "empty-rules": false, floats: false */

@eitanmk
Copy link
Contributor

eitanmk commented Jun 20, 2011

It seems JSLint detects this special comment in the parser itself. Do you think it should be in the parser for CSSLint as well?

What I ended up doing with my JSLint Rhino command is automatically concatenate an options config file to each input and then run JSLint on the joint file. However, this messes up all the line numbers by 1 since I've modified the input to the lint.

Essentially, do you think these directives should be part of the input file (like JSLint and Vim options etc) or maybe CSSLint should take a different approach? Maybe included as a -c option on the command line or as a .csslintconf file in a directory of CSS? (Just throwing out some possibilities. Not sure what my preference is yet. At least for my work JS files, it wasn't feasible to add the same options line to every file.)

@nzakas
Copy link
Contributor Author

nzakas commented Jun 20, 2011

The parser is generic and will treat this like any other comment. CSS Lint itself will look for it and set the options appropriately. You'll also be able to specify options on the command line as well when the next version comes out.

@nzakas nzakas closed this as completed in fd0cfbd Jun 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants