-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Move "good" badge helpers from lib/ to services/ #3101
Conversation
|
This will keep causing merge conflicts as service are changed. It would be great to get this merged. Have added a list of affected files to the top post. |
I can look at this one tonight |
Was debating whether to ask this here or back over on #2832 (or #2698), but how are we qualifying "good" and "bad" for helper functions? (not implying any of the functions in this PR are "bad", just not sure what puts a helper into a category) Is "bad" just helper functions that are for legacy code/that will be unneeded once the service refactor is complete? |
Yes, and |
@@ -96,32 +93,35 @@ Each service has a directory for its files: | |||
All service badge classes inherit from [BaseService] or another class which extends it. | |||
Other classes implement useful behavior on top of [BaseService]. | |||
|
|||
* [BaseJsonService](https://github.com/badges/shields/blob/master/services/base-json.js) | |||
- [BaseJsonService](https://github.com/badges/shields/blob/master/services/base-json.js) |
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.
Ah just realized these links are bad now, should be https://github.com/badges/shields/blob/master/core/base-service/base-json.js
implements methods for performing requests to a JSON API and schema validation. | ||
* [BaseXmlService](https://github.com/badges/shields/blob/master/services/base-xml.js) | ||
- [BaseXmlService](https://github.com/badges/shields/blob/master/services/base-xml.js) |
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.
should be https://github.com/badges/shields/blob/master/core/base-service/base-xml.js
class for the badges or one may already exist. | ||
|
||
[BaseService]: https://github.com/badges/shields/blob/master/services/base.js | ||
[baseservice]: https://github.com/badges/shields/blob/master/services/base.js |
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.
should be https://github.com/badges/shields/blob/master/core/base-service/base.js
|
||
module.exports = class Example extends BaseService { // (3) | ||
module.exports = class Example extends BaseService { | ||
// (3) |
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.
I'm still not a fan of how prettier moves these comments around (especially num. 3) due to their relation to the bullets below.
Maybe we could move all the numbered comments to above the line the reference to both be consistent and satisfy prettier?
This doesn't need to be a blocker IMO (given all the changes in this PR) but if we merge these Tutorial changes as-is then I do feel we should update these inline code blocks soon
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.
Ahhh my editor must have done that. Thanks for catching it.
Do you think the inline numbers would look okay? They would be a lot easier to maintain, and it'd let us stop prettier-ignoring this file.
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.
How about we merge this and one of us can deal with the broken links and formatting as a follow-on?
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.
How about we merge this and one of us can deal with the broken links and formatting as a follow-on?
Works for me!
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.
I opened #3116 just to make sure we don't accidentally forget
Thanks for the careful review! |
This moves a few helpers from
lib/
toservices/
:build-status.js
build-status.spec.js
color-formatters.js
color-formatters.spec.js
contributor-count.js
licenses.js
licenses.spec.js
php-version.js
php-version.spec.js
text-formatters.js
text-formatters.spec.js
version.js
version.spec.js
And one from
lib/
tocore/
:unhandled-rejection.spec.js
The diff is long, but the changes are straightforward.
Ref #2832