Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Unify and introduce polymorphic require of external plugins #1150

Closed
wants to merge 7 commits into from

Conversation

markelog
Copy link
Member

@markelog markelog commented Mar 8, 2015

Fixes #1083, #1030, #109.

Also add more tests and simplification of configuration modules. Some of these changes might be considered as breaking.

@mikesherov
Copy link
Contributor

what do you consider breaking here? Looks good to me otherwise!

@markelog
Copy link
Member Author

markelog commented Mar 8, 2015

For example, you could define additionalRules like that:

{
  "additionalRules":  "foo/bar"
}

now, you can do it only like that:

{
  "additionalRules":  "./foo/bar"
}

otherwise jscs will consider this value as module name

@mikesherov
Copy link
Contributor

Is there any way to preserve the old behavior without introducing too much complexity? Would be a shame to have to hold off till 2.0 for this.

@qfox
Copy link
Member

qfox commented Mar 8, 2015

@markelog Why we can't check module foo first, and then local ./foo directory if module doesn't exist?

@markelog
Copy link
Member Author

markelog commented Mar 9, 2015

@mikesherov we could consider releasing 2.0 instead of 1.12, there is some tickets/pulls that could be done/landed, plus yeah, auto-fixing is not a breaking change, but its feels like a lot, it could justify the major in pre-semver times. Even today, in many minds version change perceived not by breakage but by the functionality enhancement.

/cc @mdevils, @mrjoelkemp

@zxqfox it still be breaking, basically, we can't distinguish between the path foo and module foo.

@mikesherov
Copy link
Contributor

We've already said that autoformatting needs to be in the 1.x line.

@markelog
Copy link
Member Author

markelog commented Mar 9, 2015

You have a firm stance on it, did you make any promises?

@mikesherov
Copy link
Contributor

No, no promises made, but we already discussed this. No reason to release 2.0 over such a minor bug. If you'd like to revisit that decision, we should discuss that on the ML, no?

@markelog
Copy link
Member Author

markelog commented Mar 9, 2015

You right, will send a letter

* Loads plugin data.
*
* @param {String|function(Configuration)} plugin
* @protected
@param {String|null|function(Configuration)} plugin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@mdevils
Copy link
Member

mdevils commented Mar 16, 2015

@markelog, why are you doing refactoring, adding documentation and so on here? I can't get the idea of this Pull-request. It's lost in tons of code changes.

@mdevils
Copy link
Member

mdevils commented Mar 16, 2015

@markelog, "additionalRules": "./foo/bar" is a breaking change. Even in Yandex we have lots of projects which will be broken after this PR. And at the same time I don't see the purpose of this change.

@markelog
Copy link
Member Author

Sorry Marat, just pulled the thread, i tried to make commits as atomic as possible though, you might be better of reviewing them individually.

"additionalRules": "./foo/bar" is a breaking change.

That is what i have repeatedly said.

And at the same time I don't see the purpose of this change.

This PR mentions tickets that it would solve.

@qfox
Copy link
Member

qfox commented Mar 16, 2015

Would be great if we split this to several PRs. I need a part of it to finish .jscsignore related issue. On the other hand it would be safer to merge them.

@markelog I know it's hard to split it. But still can we make a try?

@mdevils
Copy link
Member

mdevils commented Mar 17, 2015

@zxqfox +1

@markelog
Copy link
Member Author

On the other hand it would be safer to merge them.

How so? I don't follow.

Is there something preventing you to review this by the individual commits?

@qfox
Copy link
Member

qfox commented Mar 18, 2015

Is there something preventing you to review this by the individual commits?

Only fear of incomplete code.

@markelog
Copy link
Member Author

Every commit should atomic, if there is any issues please let me know

@@ -24,22 +24,130 @@ var BUILTIN_OPTIONS = {
* @name Configuration
*/
function Configuration() {
/**
* List of the registered (not used) presets.
* @protected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newlines after descriptions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zxqfox rule for that? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, there is an issue for that :( jscs-dev/jscs-jsdoc#85

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@mrjoelkemp
Copy link
Member

Nice work here @markelog! 👍

* @param {String|function(Configuration)} plugin
* @protected
@param {String|null|function(Configuration)} plugin
* @private
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why private instead of protected? You're overriding, so it is protected.

@markelog markelog force-pushed the external branch 2 times, most recently from 6c0a7d7 to ed0f85d Compare May 31, 2015 05:35
@qfox qfox mentioned this pull request May 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify and introduce polymorphic require of external plugins
5 participants