-
Notifications
You must be signed in to change notification settings - Fork 3
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
add automated quality control & post-commit script #14
Conversation
* to change the mapping of fields or enhance products with custom | ||
* Event fired after mapping a commerce product to a product. | ||
* | ||
* This allows to change the mapping of fields or enhance products with custom |
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 agree with this change ?
The first comment must be a one line comment, the second can be multiline (drupal 8 coding standard).
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.
Maybe we could rephrase the first line to make it more clear, something like "Event to map a commerce product to a GTM product". It is really not easy given the limited characters available :)
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 it's quite a challenge.
What about this ?
/**
* Allows to alter the GTM Product field mapping.
*
* Allows alteration of field mapping from Commerce product to a GTM Product.
* Use this event to alter data Product before it gets pushed to data layer.
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.
@WengerK Thank you for setting up the code quality tools and the excellent docs! 👍
I left some nitpicking comments about some code comments ;-) One question regarding the Drupal coding standards. The docs leave it open to use camelCase
or snake_case
for variable names. Now we are mixing both styles, e.g. $this->eventTrackerService = $event_tracker_service
. I know that most Drupal modules use snake_case
(I personally prefer camel) but I think we should be consistent. What do you think?
The amount of unnecessary comments we have to write (anti-pattern) is another topic, but I know things are how they are... :)
* to change the mapping of fields or enhance products with custom | ||
* Event fired after mapping a commerce product to a product. | ||
* | ||
* This allows to change the mapping of fields or enhance products with custom |
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.
Maybe we could rephrase the first line to make it more clear, something like "Event to map a commerce product to a GTM product". It is really not easy given the limited characters available :)
Thanks for the review !
Unfortunately, the coding standard request a comment on every method :(. This is necessary for the automatic documentation generator.
I absolutely agree to be consistent; do not mix camelCase and snake_case variable naming inside a file. But, the naming convention works as follow:
So the only "black-point" is about the variables that can be both (camel or snake). Here another doc about this: https://www.drupal.org/docs/develop/standards/object-oriented-code I can live with both for variables (whitout mixing of course) so If you prefer to switch variable to PS: I will work on the change you request later this day ^^ |
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.
Add missing \
on comment for automatic documentation & IDE autocomplete
@WengerK Thanks for the explanations!
I agree, let's follow the principles from Drupal core 👍 |
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.
Add suggestions to adapte "variation title" into a more generic "variation"
This PR make a lot of changes here why:
Automated Quality Control - Pareview
I added a new Quality Control script which is the same as https://pareview.sh/ for Drupal.
You can use this scripts by:
This script will run:
Refactoring to follow Drupal Coding Standard instead of Symfony ones
Also, by adding those, I had to change a lot of code - essential for the following reasons: