-
Notifications
You must be signed in to change notification settings - Fork 46
Conversation
@markelog and @mikesherov, any opinions? |
Looks good (though the pr changes a lot of tests, not sure if that was intentional). I'd recommend maybe not exposing the In the - options = this.options(),
+ options = this.options(
+ config: true
+ } ), |
Good catch @Krinkle! The tests were intentionaly changed because they were "conditional" (inside an |
@gustavohenke I don't really know anything about the internals of this grunt task. I just found the changes seemingly unrelated to changing the default value of the Anyway, I guess you're just taking the opportunity to clean up other things at the same time. No need to explain it to me :-) |
Sorry, i didn't chime in at the moment, was busy working on releasing
Agree on I like the idea of merging inline options and Originally, it was my intention to expose |
While I agree mostly @markelog, I think parity with JSHint is the easiest for devs to understand. All I know is that you should not have to explicitly specify the config file in the absence of rules defined in the config. The following is what I expect the behavior to be:
Lastly, we can add a new config option: |
I think this is a good idea.
This one makes sense, should be done.
Or |
correct. |
@mikesherov sounds much more reasonable :-)
So
Which would be just an alias for |
Basically, except the only possible value is |
|
That's two very similar options, i would go with one: It might easier to think that |
OK. Fair enough. |
+1. Having two options seems confusing. Having a "jscsrc" would match grunt-contrib-jshint a bit, but if we would implement it as only taking boolean we might as well not try to be like grunt-contrib-jshint since it'd be quite different still. In fact, I'd argue keeping just |
|
||
if ( configOption && typeof configOption === "string" ) { | ||
if ( !grunt.file.exists( configOption ) ) { | ||
grunt.fatal( "The config file \"" + configOption + "\" was not found" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could use grunt.warn
instead for these messages, @markelog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sounds more user friendly, although its weird that user would want force
execution in this situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will do after this PR gets merged in
@mikesherov, @markelog, @Krinkle, anyone has further doubts about this PR after the last commits? |
Type: `String` | ||
Default value: `null` | ||
Type: `String`, `Boolean` | ||
Default value: `undefined` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
is not a string or a boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will adjust the docs!
I've updated the docs to match the new behavior of the config option. |
Lgtm! |
The documented behaviour looks good (I haven't verified the implementation). I'm not quite sure what the purpose is of having both |
If you specify |
By default, when the
config
option isundefined
, or when it'strue
, the JSCS config loader will be used with no specific file passed in.If
config
is a string, it will use the config loader only to parse it, as it used to be until nowIf a falsy value is given, no config loading will be done and the config will be empty.
Also, this PR fixes some "conditional" unit tests.
Fixes #20